var e = {},
  t = "",
  o = null,
  n = null,
  i = 1,
  r = null;

let s = {
  offerId: "",
  scale: "",
  zoneId: "",
  pf: ""
};
var a = "undefined" != typeof window ? window : GameGlobal || {},
  c = {};
let l;
var d = [],
  u = {
    b_site: ""
  };
try {
  var p = require("./p8sdk-wechat-ad-config");
  var wx = require("weixin-js-sdk");
  console.log(wx);
} catch (e) {}
function g(e, t, o, n, i) {
  
  wx.request({
    url: e,
    method: t,
    data: o,
    success: e => {
      n && n(e);
    },
    fail: e => {
      i && i(e);
    }
  });
}
function h(e, t, o, n, i) {
  wx.request({
    url: e,
    method: t,
    data: o,
    timeout: 2e3,
    success: e => {
      n && n(e);
    },
    fail: r => {
      h(e, t, o, n, i), i && i(r);
    }
  });
}
function f(e, t, o, n, i, r = 0, s = 20) {
  r >= s ? i && i(new Error("达到的最大重试次数:wxRequestConFigShort")) : wx.request({
    url: e,
    method: t,
    data: o,
    timeout: 5e3,
    success: e => {
      n && n(e);
    },
    fail: a => {
      setTimeout(() => {
        f(e, t, o, n, i, r + 1, s);
      }, 1e3), i && i(a);
    }
  });
}
function m() {
  let e = "";
  for (let t = 0; t < 20; t++) {
    if (!arguments[t]) return void console.info(e);
    e += " " + JSON.stringify(arguments[t]);
  }
}
function y(e) {
  return wx.CryptoJS.MD5(e).toString();
}
function _(e) {
  return wx.CryptoJS.enc.Utf8.parse(e);
}
function v(e, t, o, n = null) {
  const i = _(o),
    r = _(n);
  return wx.CryptoJS.AES.decrypt(t, i, {
    iv: r,
    mode: e,
    padding: wx.CryptoJS.pad.Pkcs7
  }).toString(wx.CryptoJS.enc.Utf8);
}
function w(e) {
  return new Promise(t => {
    let o = wx.getAccountInfoSync().miniProgram.appId;
    console.log("p8sdk版本:", "2.0.20"), console.log("appid:", o);
    let n = `https://ksyun.oss-cn-hangzhou.aliyuncs.com/${o}.txt?time=${Date.now()}`;
    console.log("configUrl", n), B.appid = o, f(n, "GET", "", function (n) {
      if (200 == n.statusCode) {
        let i = S(n);
        console.log("加密数据data::", i);
        let r,
          s = y(o),
          a = v(wx.CryptoJS.mode.ECB, i, s),
          c = JSON.parse(a),
          l = c.mini_game,
          d = c.url_address;
        console.log("gameConfig:", l), console.log("urlAddress:", d), l && (r = -1 != B.platform.toLowerCase().indexOf("ios") || -1 != B.platform.toUpperCase().indexOf("IOS") ? l.ios : l.android, Object.assign(B, {
          key: r.key,
          site: r.site,
          aid: r.aid
        }), B.game_id = r.data_gid ? r.data_gid : r.aid.slice(-4)), d ? (console.log("获取到的url_address", d), Object.assign(B, {
          platform_url: d.platform_url,
          data_url: d.data_url,
          rg_url: d.rg_url
        }), t(), new Promise(e => {
          let t = parseInt(new Date().getTime() / 1e3),
            o = {
              site: B.site,
              appid: B.appid,
              time: t
            },
            n = j(o);
          o.sign = y(n);
          let i = B.platform_url + "/api/gameBox";
          m("请求 盒子请求参数拼接url: ", i + "?" + te(o)), g(i, "GET", o, t => {
            B.gameBoxData = t.data.data.config, B.box_id = t.data.data.box_id, e();
          }, t => {
            m("盒子请求 失败返回data", JSON.stringify(t)), e();
          });
        }), e && e()) : wx.showModal({
          title: "aid 配置异常",
          content: "异常",
          success(e) {}
        });
      } else 404 == n.statusCode && console.error("该appid.txt不存在，请运营确认是否配置再进行登录");
    }, function (e) {
      console.error("请求失败，请确认域名是否正确 ", e);
    });
  });
}
function S(e) {
  return e.data ? e.data : e;
}
function C() {
  let e,
    t = new Date(),
    o = "YYYY-mm-dd HH:MM:SS";
  const n = {
    "Y+": t.getFullYear().toString(),
    "m+": (t.getMonth() + 1).toString(),
    "d+": t.getDate().toString(),
    "H+": t.getHours().toString(),
    "M+": t.getMinutes().toString(),
    "S+": t.getSeconds().toString()
  };
  for (let t in n) (e = new RegExp("(" + t + ")").exec(o)) && (o = o.replace(e[1], 1 == e[1].length ? n[t] : n[t].padStart(e[1].length, "0")));
  return o;
}
let x;
var P = {
  weixinadinfo: "",
  gdt_vid: "",
  aid: "",
  code: "",
  c: ""
};
let B = {
  mdsVersion: "2.0",
  platform_url: "",
  data_url: "",
  key_android: "",
  site_android: "",
  key_ios: "",
  site_ios: "",
  aid: "",
  monitorAid: "",
  uid: "",
  sid: "",
  sname: "",
  roleid: "1",
  rolename: "1",
  vip: "",
  level: "",
  gold: "",
  mac: "",
  device: "",
  modeltype: "wx",
  device_type: "1",
  gameversion: "",
  device_model: "",
  device_resolution: "",
  device_version: "",
  device_net: "",
  device_orientation: "",
  device_code: "",
  platform: "",
  initOnshowFlag: !0,
  onshowFlag: !0,
  account: "",
  password: "",
  gameBoxData: [],
  box_id: "",
  scene_id: "",
  game_id: "",
  blacklistCode: "",
  adIaaData: {}
};
var b, k, z, I;
function T() {
  console.trace("==============");
  if (o) return;
  let e = parseInt(new Date().getTime() / 1e3),
    t = {
      site: B.site,
      aid: B.aid,
      uid: B.uid,
      time: e
    },
    n = j(t, B.key);
  t.sign = y(n), m("跳包开关参数请求obj ", t), g(B.platform_url + "/switch/wxSwitch", "GET", t, function (e) {
    let t = e.data.data;
    if (m("跳包开关返回的值:", t), t.redirect && t.redirect.s) {
      m("跳包开关返回的值 可以转端:", t.redirect.data);
      let e = t.redirect.data.msg,
        o = t.redirect.data.b_appid,
        n = {
          p8go_site: t.redirect.data.site,
          p8go_aid: t.redirect.data.aid,
          b_site: t.redirect.data.b_site,
          b_appid: o
        };
      console.error("edata::", n), wx.onTouchStart(() => {
        !function (e, t, o) {
          m("跳包开关返回的值 可以转端: gotoAnotherApp", e, t), wx.showModal({
            title: "提示",
            content: e || "提示文本",
            confirmText: "确认",
            showCancel: !1,
            confirmColor: "#576B95",
            success: function (e) {
              e.confirm ? (console.log("用户点击确定"), c.gotoSystem(t, e, o)) : e.cancel && console.log("用户点击取消");
            },
            fail: function (e) {
              m("showModal 失败", e);
            }
          });
        }(e, o, n);
      });
    }
  });
}
a.sdkData = B, function () {
  wx.getNetworkType({
    success: function (e) {
      B.device_net = e.networkType;
    }
  });
  let e = wx.getSystemInfoSync();
  console.log("设备信息:", e);
  var t = e.platform;
  B.modeltype = t, B.platform = t, B.device_model = e.model, B.device_resolution = e.screenWidth + "*" + e.screenHeight, B.device_version = e.system, B.gameversion = e.version, B.device_orientation = e.deviceOrientation;
}(), function () {
  let n = wx.getLaunchOptionsSync().query,
    i = wx.getLaunchOptionsSync().referrerInfo;
  n || (n = wx.getEnterOptionsSync().query) && n.aid && G(" mark0");
  let r = JSON.stringify(n);
  r.length > 2 && (t = r);
  let s = i && i.extraData;
  s && s.p8go_site && s.p8go_aid && (console.error("冷启动 获取到跳转过来的参数", s), o = !0, u.site = s.p8go_site, u.aid = s.p8go_aid, u.b_site = s.b_site, u.b_appid = s.b_appid, console.log(" 冷启动 extraData.goto_aid:", s.goto_aid)), n.clue_token && (E = "TT", e.clue_token = n.clue_token, e.ad_id = n.ad_id, e.creative_id = n.creative_id, e.channel = "jrtt_wxxyx"), (n.aid || n.code) && Object.assign(P, n);
}(), function () {
  let e = wx.getLaunchOptionsSync().scene;
  m("场景值：", e), B.scene_id = e;
}(), function () {
  try {
    if ("undefined" != typeof requirePlugin) {
      const e = (0, requirePlugin("MiniGameCommon", {
        enableRequireHostModule: !0,
        customEnv: {
          wx: wx
        }
      }).default)();
      void 0 === e || void 0 === e.canIUse ? console.error("miniGameCommon create error") : (GameGlobal.miniGameCommon = e, console.log("miniGameCommon create success"));
    }
  } catch (e) {}
}(), async function () {
  try {
    await w(), await new Promise(e => {
      let t = parseInt(new Date().getTime() / 1e3),
        o = {
          site: B.site,
          appid: B.appid,
          channel: "wx",
          time: t
        },
        n = j(o, B.key);
      o.sign = y(n), m("支付配置参数请求obj ", o), g(B.platform_url + "/api/wxGameConf", "GET", o, function (t) {
        let o = t.data.data;
        0 == t.data.result && 1 == o.is_set ? (s.offerId = o.offerId, s.scale = o.scale, s.zoneId = o.zoneId, s.pf = o.pf, e()) : 0 == t.data.result && 0 == o.is_set ? (console.error("参数沒有配置 运营要先后台配置"), e()) : 1 == t.data.result && m("接口請求失敗");
      }, function (e) {
        m("请求支付配置接口失败" + JSON.stringify(e));
      });
    }), await H(), await new Promise(e => {
      let t = parseInt(new Date().getTime() / 1e3),
        o = {
          site: B.site,
          types: "38|39|40",
          time: t
        },
        n = j(o);
      o.sign = y(n), console.log("开关请求参数 obj", o), h(B.platform_url + "/switch/switchListS", "post", o, t => {
        let o = t.data;
        if (o && 0 === o.result) {
          let t = o.data;
          t[38].s && (c.showLoadPage = function () {
            A(t[38].content);
          }), t[39].s && (c.showCustomerServicePage = function () {
            A(t[39].content);
          }), t[40].s && (c.showPayPage = function () {
            A(t[40].content);
          }), e();
        } else console.error("请求switchList数据失败", o);
      }, e => {
        console.error("请求switchList数据异常", e);
      });
    });
  } catch (e) {
    console.error("p8sdk版本:2.0.20/p8sdk入口加载失败:", e);
  }
}(), wx.onShow(e => {
  console.log("onshow~~", e);
  let n = e.query,
    i = JSON.stringify(n);
  i.length > 2 && (t = i);
  let r = e.referrerInfo && e.referrerInfo.extraData;
  r && r.p8go_site && r.p8go_aid && (o = !0, console.error("onshow 获取到跳转过来的参数", r), console.error("冷启动 获取到跳转过来的参数", r), u.site = r.p8go_site, u.aid = r.p8go_aid, u.b_site = r.b_site, u.b_appid = r.b_appid), n.aid && (Object.assign(P, n), m("onShow存在启动参数 query", P), G("onShow 存在aid" + JSON.stringify(e)));
}), c.wxshowShareMenu = function (e = "", t = "", o = "") {
  m("p8sdk 显示菜单分享 接口调用", arguments), wx.showShareMenu({
    withShareTicket: !0,
    menus: ["shareAppMessage", "shareTimeline"]
  }), wx.onShareAppMessage(() => ({
    title: e,
    imageUrl: t,
    query: o
  }));
}, c.wxshareAppMessage = function (e = "", t = "", o = "", n = "") {
  m("p8sdk 主动分享 接口调用", arguments), wx.shareAppMessage({
    title: e,
    imageUrl: t,
    query: o,
    imageUrlId: n
  });
}, c.wxADinit = function (e, t, o, n) {
  console.log("微信广告初始化"), p && (e || (e = p.adUnitId, console.log("本地配置广告id "))), e && (console.log("激励视频id ", e), (b = wx.createRewardedVideoAd({
    adUnitId: e,
    multiton: !0
  })).load().then(() => {
    m("激励视频 广告加载成功");
  }), b.onLoad(() => {
    m("激励视频 广告加载事件成功");
  }), b.onError(e => {
    m("激励视频 广告加载异常", e);
  })), o && (console.log("广告 banner  ", o), o.adUnitId ? function (e, t = 0, o = 0, n = "", i) {
    let r = wx.getSystemInfoSync().screenWidth;
    n || (n = r), (k = wx.createBannerAd({
      adUnitId: e,
      adIntervals: 30,
      style: {
        left: t,
        top: o,
        width: n,
        height: i
      }
    })).onLoad(() => {
      m("banner 广告加载成功 ", k.style), window.bannerHeight = k.style.realHeight;
    }), k.onResize(e => {
      m("banner 广告onResize", e.width, e.height), m("banner 广告onResize2", k.style.realWidth, k.style.realHeight);
    }), k.onError(e => {
      m("banner 广告异常", e);
    });
  }(o.adUnitId, o.left, o.top, o.width, o.height) : m("广告初始化 banner广告参数不对 ")), t && (console.log("插屏广告   ", t), (z = wx.createInterstitialAd({
    adUnitId: t
  })).load(() => {
    m("插屏 广告加载成功");
  }), z.load().then(() => {
    m("插屏 广告加载成功");
  }), z.onLoad(() => {
    m("插屏 广告加载事件成功");
  }), z.onError(e => {
    m("插屏 广告加载异常", e);
  })), n && (console.log("原生模板广告   ", n), n.adUnitId ? function (e, t = 0, o = 0, n = "") {
    let i = wx.getSystemInfoSync().screenWidth;
    n || (n = i), (I = wx.createCustomAd({
      adUnitId: e,
      style: {
        left: t,
        top: o,
        width: n,
        fixed: !0
      }
    })).onLoad(() => {
      m("模板 广告加载成功");
    }), I.onError(e => {
      m("模板 广告异常", e);
    });
  }(n.adUnitId, n.left, n.top, n.width) : m("广告初始化 原生模板广告参数不对 "));
}, c.msgSecCheck = e => new Promise(t => {
  var o = parseInt(new Date().getTime() / 1e3);
  let n = B.site,
    i = {
      appid: e.appid || B.appid,
      openid: e.openid || B.openid,
      site: n,
      content: e.content,
      time: o
    },
    r = B.key + "WX" + n + "WX" + o + o;
  i.sign = re(r), console.log("上报的数据是", i), h(B.platform_url + "/wx/msgSecCheckNew", "POST", i, function (e) {
    if (m("内容安全成功", i), 0 == (e = e.data).result) {
      let o = {
          100: "正常",
          10001: "广告",
          20001: "时政",
          20002: "色情",
          20003: "辱骂",
          20006: "违法犯罪",
          20008: "欺诈",
          20012: "低俗",
          20013: "版权",
          21000: "其他"
        }[e.data.label],
        n = {
          result: 0,
          isSafe: e.data.s,
          label: e.data.label,
          msg: o || "未记录异常"
        };
      t(n);
    } else {
      let o = {
        result: 1,
        msg: JSON.stringify(e)
      };
      t(o);
    }
  });
}), c.sceneADShow = (e, t) => {
  if (!z || !z.show()) return void m("插屏广告不存在");
  z.show().catch(e => {
    m("插屏 广告显示异常", e), t && t();
  });
  const o = () => {
    z.offClose(o), m("插屏 广告关闭"), e && e(), z.load().then(() => {
      m("插屏 广告加载成功");
    });
  };
  z.onClose(o);
}, c.videoADShow = function (e, t, o) {
  b && b.show ? (i = 1, r = setInterval(() => {
    i++;
  }, 1e3), b.show().catch(e => {
    m("激励视频 广告加载异常 再次广告加载", e), b.load().then(() => b.show().catch(e => {
      o && o(e);
    })).catch(e => {
      o && o(e);
    });
  }), b.offError(), b.onError(e => {
    m("激励视频 广告加载异常.....", e), o && o(e);
  }), b.onClose(o => {
    b.offClose(), clearInterval(r), r = null, o && o.isEnded || void 0 === o ? (m("正常播放结束，可以下发游戏奖励"), e && e()) : (m("播放中途退出，不下发游戏奖励"), t && t());
  })) : m("激励视频不存在");
}, c.bannerAdShow = () => {
  k && k.show ? k.show() : m("bannerAD不存在");
}, c.bannerAdHide = () => {
  k.hide();
}, c.customADShow = () => {
  I && I.show ? I.show() : m("模板 广告不存在");
}, c.customADHide = () => {
  I.hide();
}, c.customADOnclose = e => {
  const t = () => {
    I.offClose(t), I && I.onClose ? e && e() : m("模板 广告不存在");
  };
  I.onClose(t);
}, c.dialogShow = function () {
  wx.showModal({
    title: "提示",
    content: "这是一个模态弹窗",
    success(e) {
      e.confirm ? console.log("用户点击确定") : e.cancel && console.log("用户点击取消");
    }
  });
}, c.createPhoneNumberPage = function () {
  const e = document.createElement("div");
  e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.width = "100%", e.style.height = "100%", e.style.backgroundColor = "rgba(0, 0, 0, 0.5)", e.style.display = "flex", e.style.alignItems = "center", e.style.justifyContent = "center";
  const t = document.createElement("div");
  t.style.backgroundColor = "#fff", t.style.padding = "20px", t.style.borderRadius = "5px";
  const o = document.createElement("input");
  o.type = "tel", o.placeholder = "请输入手机号";
  const n = document.createElement("button");
  n.textContent = "提交", t.appendChild(o), t.appendChild(n), e.appendChild(t);
  const i = cc.find("CanvasTest");
  i.fillStyle = "rgba(0, 0, 0, 0.5)", i.fillRect(0, 0, i.width, i.height), i.fillStyle = "#fff", i.fillRect(i.width / 2 - t.offsetWidth / 2, i.height / 2 - t.offsetHeight / 2, t.offsetWidth, t.offsetHeight), n.addEventListener("click", function () {
    const e = o.value;
    console.log("用户输入的手机号：", e), i.clearRect(0, 0, i.width, i.height);
  });
}, c.gotoSystemSwitch = function () {
  return m("转端开关检测: " + C()), new Promise(e => {
    1 == l ? (e({
      result: "0",
      data: {
        msg: "已达到转端条件，可以转端"
      }
    }), m("可以转端")) : (e({
      result: "1",
      data: {
        msg: "未达到转端条件，不可以转端"
      }
    }), m("不可以转端"));
  });
}, c.unityJumpBox = function (e) {
  m("p8sdk unity盒子跳转", arguments);
  let t = Object.assign({}, {
      key: "123"
    }),
    o = JSON.parse(e).app_id,
    n = JSON.parse(e).sort;
  c.gotoSystemCustom(o, t, "active", n), J("click", n);
}, c.gotoSystem = function (e, t, o) {
  m("p8sdk wx跳转别的小程序 接口调用", arguments), wx.navigateToMiniProgram({
    appId: e,
    extraData: t,
    path: o,
    envVersion: "release",
    success(e) {
      m(" 跳转别的小程序 success  :", e);
    },
    fail(e) {
      m("跳转别的小程序 fail  :", e);
    }
  });
}, c.gotoSystemCustom = function (e, t, o, n) {
  m("p8sdk wx跳转别的小程序自定义 接口调用", arguments), wx.navigateToMiniProgram({
    appId: e,
    extraData: t,
    envVersion: "release",
    success(e) {
      m(" 跳转别的小程序 success  :", e), J(o, n);
    },
    fail(e) {
      m("跳转别的小程序 fail  :", e);
    }
  });
};
var D,
  E = "";
function A(e) {
  if (console.info("contentUrl:", e), !e) return;
  function t(e, t = null) {
    let o = new cc.Node(e);
    return t && (o.parent = t), o;
  }
  let o = t("firstPage");
  o.addComponent(cc.BlockInputEvents);
  let n = o.addComponent(cc.Widget);
  n.isAlignVerticalCenter = !0, n.isAlignHorizontalCenter = !0, o.zIndex = 999, cc.game.addPersistRootNode(o);
  let i = o.addComponent(cc.Sprite),
    r = t("tipLabel", o),
    s = r.addComponent(cc.Label);
  s.fontSize = 28;
  let a = t("closeBtnNode", o);
  a.zIndex = 9999, M(a.addComponent(cc.Sprite), "https://h5bg.ks3-cn-guangzhou.ksyuncs.com/return.png", () => {
    a.x = 230, a.y = 320;
  }), M(i, e, () => {
    console.error("posY:", i._spriteFrame._rect.height), console.error("posX:", i._spriteFrame._rect.width), s.string = "", r.y = -i._spriteFrame._rect.height / 2;
  }), a.on("touchstart", () => {
    F("close"), o.active = !1;
  }, this);
}
function N(e, t = 0, o = 20) {
  if (console.log("-------------cc", cc), console.log("-------------showCodeUrlTips", e), t >= o) return void (fail && fail(new Error("达到的最大重试次数:showCCPopupPageNew")));
  function n(e, t = null) {
    let o = new cc.Node(e);
    return t && (o.parent = t), o;
  }
  let i = cc.director.getScene();
  if (console.log("---------currentScene", i), i) {
    let t = (i.getChildByName("Canvas") ? i.getChildByName("Canvas") : i.getChildByName("CanvasTest")).getContentSize(),
      o = wx.getWindowInfo();
    console.log("------------wxSize", o), console.log("------------canvasSize", t);
    let r = t.width / 10,
      s = t.height / 10;
    console.log("aPosx", r), console.log("aPosy", s);
    let a = n("firstPage");
    a.addComponent(cc.BlockInputEvents), a.zIndex = 999, cc.game.addPersistRootNode(a);
    let c = a.addComponent(cc.Sprite),
      l = e;
    console.log("codeBtnUrl", l);
    let d = n("codeBtnNode", a);
    d.zIndex = 9999;
    let u = d.addComponent(cc.Sprite),
      p = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/greenCloseBtn.png",
      g = n("closeBtnNode", a);
    g.zIndex = 9999;
    let h = g.addComponent(cc.Sprite),
      f = "",
      m = "",
      y = "",
      _ = "",
      v = "",
      w = "";
    "portrait" == B.device_orientation ? (_ = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/payCodeTipsV.png", v = "500", w = "500", f = () => {
      console.error("posY:", c._spriteFrame._rect.height), console.error("posX:", c._spriteFrame._rect.width), a.x = 375, a.y = 667;
    }, m = () => {
      d.x = 0, d.y = 180, d.width = 500, d.height = 500;
    }, y = () => {
      g.x = 280, g.y = 470, g.width = 89, g.height = 101;
    }) : (_ = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/payCodeTipsH.png", v = "220", w = "220", f = () => {
      console.error("posY:", c._spriteFrame._rect.height), console.error("posX:", c._spriteFrame._rect.width), a.x = 375, a.y = 667, a.width = 600, a.height = 400;
    }, m = () => {
      d.x = 0, d.y = 30, d.width = 220, d.height = 220;
    }, y = () => {
      g.x = 140, g.y = 140, g.width = 40, g.height = 45;
    }), function (e, t, o, n, i) {
      if (!t.startsWith("data:")) return void console.error("不是base64图片链接");
      console.log("data:", t);
      const r = new Image();
      r.src = t, r.onload = () => {
        let t = new cc.Texture2D();
        t.initWithElement(r), t.width = n, t.height = i;
        let o = new cc.SpriteFrame(t);
        e.spriteFrame = o;
      }, o && o();
    }(u, l, m, v, w), M(h, p, y), M(c, _, f), g.on("touchstart", () => {
      a.active = !1;
    }, this);
  } else setTimeout(() => {
    N(e, t + 1, o);
  }, 1e3);
}
function O(e, t = 0, o = 20) {
  function n(e, t = null) {
    let o = new cc.Node(e);
    return t && (o.parent = t), o;
  }
  console.log("-------------cc", cc), console.log("-------------showCodeUrlTipsNew", e);
  let i = cc.director.getScene();
  if (t >= o) fail && fail(new Error("达到的最大重试次数:showCCPopupPageNew"));else if (console.log("---------currentScene", i), i) {
    let t = i.getChildByName("Canvas") ? i.getChildByName("Canvas") : i.getChildByName("CanvasTest"),
      o = t.getContentSize();
    console.log("------------canvasSize", o);
    let r = o.width / 10,
      s = o.height / 10;
    console.log("aPosx", r), console.log("aPosy", s);
    let a = n("firstPage");
    a.addComponent(cc.BlockInputEventsComponent), t.addChild(a), a.layer = 33554432;
    let c = a.addComponent(cc.Sprite),
      l = e;
    console.log("codeBtnUrl", l);
    let d = n("codeBtnNode", a);
    d.layer = 33554433;
    let u = d.addComponent(cc.Sprite),
      p = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/greenCloseBtn.png",
      g = n("closeBtnNode", a);
    g.layer = 33554434;
    let h = g.addComponent(cc.Sprite),
      f = "",
      m = "",
      y = "",
      _ = "",
      v = "",
      w = "";
    "portrait" == B.device_orientation ? (_ = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/payCodeTipsV.png", v = "500", w = "500", f = () => {
      a.setPosition(0, 0);
    }, m = () => {
      d.setPosition(0, 180), d.setContentSize(500, 500);
    }, y = () => {
      g.setPosition(280, 470), g.setContentSize(89, 101);
    }) : (_ = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/payCodeTipsH.png", v = "220", w = "220", f = () => {
      a.getComponent(cc.UITransformComponent).setContentSize(o.x / 1.2, o.y - 40), a.setPosition(0, -20);
    }, m = () => {
      let e = 1 * s,
        t = 3 * r;
      d.setPosition(0, e), d.setContentSize(t, t);
    }, y = () => {
      let e = 4 * s,
        t = .6 * r;
      g.setPosition(e, e), g.setContentSize(t, t + 5);
    }), U(h, p, y, t), U(c, _, f, t), function (e, t, o) {
      if (!t.startsWith("data:")) return void console.error("不是base64图片链接");
      console.log("data:", t);
      const n = new Image();
      n.src = t, n.onload = () => {
        const t = new cc.ImageAsset(n),
          i = new cc.Texture2D();
        i.image = t;
        const r = new cc.SpriteFrame();
        r.texture = i, e.spriteFrame = r, o && o();
      };
    }(u, l, m), g.on(cc.Node.EventType.TOUCH_START, () => {
      a.active = !1;
    }, this);
  } else setTimeout(() => {
    O(e, t + 1, o);
  }, 1e3);
}
function M(e, t, o) {
  t.startsWith("https://") || (t = "https://ks3-cn-shanghai.ksyuncs.com" + t), cc.loader.load(t, function (t, n) {
    t ? m("cc.loader.load网络加载图片失败", t) : (e.spriteFrame = new cc.SpriteFrame(n), o && o());
  });
}
function U(e, t, o, n) {
  t.startsWith("https://") || (t = "https://ks3-cn-shanghai.ksyuncs.com" + t), cc.assetManager.loadRemote(t, {
    ext: ".png"
  }, (t, i) => {
    if (t) console.error(t);else {
      let t = n.getComponent(cc.UITransformComponent).contentSize,
        r = t.x,
        s = t.y,
        a = new cc.SpriteFrame(),
        c = new cc.Texture2D();
      c.image = i, a.texture = c, e.spriteFrame = a, n.getComponent(cc.UITransformComponent).setContentSize(r, s), o && o();
    }
  });
}
function H(o) {
  return new Promise(i => {
    if (n) return n.msg = "此处表示sdk内部已经获取过这个值,再次调用会返回已经获取过的值", i(n), void console.log("loginResult", n);
    wx.login({
      success(r) {
        var s = r.code;
        s || i({
          result: "999",
          data: {},
          msg: "调用微信原生的登录成功 但不存在code" + JSON.stringify(r)
        });
        let h = parseInt(new Date().getTime() / 1e3);
        u.aid && (B.b_site = u.b_site, B.b_appid = u.b_appid, B.aid = u.aid, B.site = u.site);
        var _ = y(`${B.key}WX${B.site}WX${h}${h}`);
        let w = {
          cname: "wxxyx",
          js_code: s,
          channel_parame: t,
          aid2: P.aid,
          code: P.code,
          gdt_vid: P.gdt_vid,
          c: P.c,
          weixinadinfo: P.weixinadinfo,
          modeltype: B.modeltype ? B.modeltype : "test",
          aid: B.aid,
          appid: B.appid,
          site: B.site,
          b_site: u.b_site,
          sign: _,
          time: h,
          scene: B.scene_id
        };
        "TT" === E && (o.clue_token = e.clue_token, o.ad_id = e.ad_id, o.creative_id = e.creative_id, o.channel = e.channel);
        let S = B.platform_url + "/oauth/wxLoginToReport",
          C = S + "?" + te(w);
        m("登录login请求url ", S), m("登录login请求参数 ", w), m("登录login参数拼接url: ", C), f(S, "POST", w, function (e) {
          if (m("登录成功回调返回的所有参数：", e), 0 == (e = e.data).result) {
            let t = e.data;
            B.sign = _, B.time = h, B.account = t.account, B.password = t.password;
            let o = y(B.appid),
              s = y("wx1b5da6219196e9b5"),
              u = v(wx.CryptoJS.mode.ECB, t.d, o),
              f = "+5hOk+KBQm2+yRHjXse5djoBkDR/GVPYEsIJcuDFOfk=",
              w = v(wx.CryptoJS.mode.ECB, f, s);
            console.log("解密出的a1", w), x = u, B.openid = x, G("已经获取到了openid" + JSON.stringify(P)), B.device = x, t.uid += "", B.uid = t.uid + "", m("登录成功回调 进行赋值", B), m("查询本地是否有广告id配置文件 ", p);
            let S = {
              result: "0",
              data: {
                openid: x,
                session_key: t.session_key,
                sign: _,
                time: h,
                js_code: r.code,
                site: B.site,
                appid: B.appid,
                adUnitId: p ? p.adUnitId : ""
              }
            };
            Object.assign(S.data, t), T(), a.cc && (c.showLoadPage && c.showLoadPage(), c.lvcompare && c.lvcompare()), function () {
              let e = wx.getStorageSync("deviceCode");
              e || (e = re(B.openid + new Date().getTime() / 1e3), wx.setStorageSync("deviceCode", e), m(" 未有deviceCode生成一个新的： " + e)), B.device_code = e;
            }(), function () {
              let e = parseInt(new Date().getTime() / 1e3),
                t = {
                  site: B.site,
                  aid: B.aid,
                  time: e,
                  uid: B.uid
                },
                o = j(t, B.key);
              t.sign = y(o), m("弹窗开关参数 ", t), g(B.platform_url + "/switch/wxToMsg", "GET", t, function (e) {
                let t = e.data.data;
                W("show_num") || L("show_num", 1), console.log("getItem show_num ", W("show_num"));
                let o = W("show_num");
                m("弹窗开关返回的值:", t), 1 == t.s && o <= t.show_num ? (L("show_num", o += 1), wx.showModal({
                  title: t.title,
                  content: t.content,
                  showCancel: !1,
                  confirmText: t.bot_title,
                  success(e) {
                    e.confirm && (console.log("用户点击确定"), 1 == t.is_cope ? wx.setClipboardData({
                      data: t.bot_content,
                      success(e) {
                        wx.getClipboardData({
                          success(e) {
                            console.log("复制内容：", e);
                          }
                        });
                      }
                    }) : m("复制未开启"));
                  }
                })) : m("请求失败");
              });
            }(), function () {
              let e = parseInt(new Date().getTime() / 1e3),
                t = {
                  site: B.site,
                  time: e,
                  uid: B.uid,
                  appid: B.appid
                },
                o = j(t, B.key);
              t.sign = y(o), g(B.platform_url + "/mGame/rewardedVideoAdId", "GET", t, function (e) {
                m("getOnlineRewardId返回的值:", e), B.adIaaData = e.data.data, B.adIaaData.RewardedVideoAd && c.wxADinit(B.adIaaData.RewardedVideoAd), B.adIaaData.InterstitialAd && c.wxADinit("", B.adIaaData.InterstitialAd);
              });
            }(), function () {
              let e = parseInt(new Date().getTime() / 1e3),
                t = {
                  site: B.site,
                  time: e,
                  type: "42",
                  ext: "appid",
                  default: "0"
                },
                o = j(t, B.key);
              t.sign = y(o), m("42开关参数", t), g(B.platform_url + "/switch/switchList", "GET", t, function (e) {
                m("42开关返回的值:", e), wx.setStorageSync("extAppid", e.data.data.appid);
              });
            }(), function (e) {
              let t = parseInt(new Date().getTime() / 1e3),
                o = {
                  site: B.site,
                  time: t,
                  type: "54",
                  default: "1",
                  wx_scene_id: e
                },
                n = j(o, B.key);
              o.sign = y(n), m("54开关参数", o), g(B.platform_url + "/switch/switchListN", "GET", o, function (e) {
                m("54开关返回的值:", e);
                let t = e.data.result;
                B.blacklistCode = t;
              });
            }(B.scene_id), function () {
              let e = parseInt(new Date().getTime() / 1e3),
                t = {
                  site: B.site,
                  time: e,
                  type: "63",
                  default: "0",
                  ext: "appid"
                },
                o = j(t, B.key);
              t.sign = y(o), m("63开关参数", t), g(B.platform_url + "/switch/switchListN", "GET", t, function (e) {
                m("63开关返回的值:", e), wx.setStorageSync("priAppid", e.data.data.appid);
              });
            }(), function () {
              let e = parseInt(new Date().getTime() / 1e3),
                t = {
                  site: B.site,
                  aid: B.aid,
                  time: e,
                  uid: B.uid
                },
                o = j(t, B.key);
              t.sign = y(o), m("跳转别的小程序参数 ", t), g(B.platform_url + "/switch/wxToApp", "GET", t, function (e) {
                m("转端获取到的参数 ", e), l = e.data.data.s;
              });
            }(), function () {
              let e = parseInt(new Date().getTime() / 1e3);
              console.log(e);
              let t = {
                site: B.site,
                aid: B.aid,
                time: e
              };
              console.log("a", t);
              let o = j(t);
              t.sign = y(o), m("订阅推送消息请求参数 ", t);
              let n = B.platform_url + "/oauth/getWxSubscriptionId";
              g(n, "GET", t, e => {
                if (m("订阅推送消息请求的url:", n), m("订阅推送消息获取到的data", e), 0 == e.data.result) {
                  let t = e.data.data.template_id;
                  if (t) {
                    let e = t.split(",");
                    for (let t = 0; t < e.length; t++) {
                      const o = e[t];
                      -1 == d.indexOf(o) && d.push(o);
                    }
                  } else m("没有配置订阅模板id");
                  m("订阅推送消息获取到的id", e.data.data.template_id);
                } else m("请求订阅模板id异常 请求参数", e.data, t);
              }, e => {
                m("订阅推送消息获取服务器数据失败", e);
              });
            }(), Q(), n = S, setTimeout(() => {
              n = null;
            }, 6e4), i(S);
          } else {
            let t = {
                "-1": "系统繁忙，此时请开发者稍候再试",
                40029: "code 无效",
                45011: "频率限制，每个用户每分钟100次",
                40226: "高风险等级用户，小程序登录拦截 。风险等级详见用户安全解方案"
              },
              o = {
                result: "1",
                msg: "p8sdk服务端请求微信异常",
                data: {
                  errorcode: e && e.errorcode,
                  msg: e.msg,
                  reqData: w,
                  wxTip: e && t[e.errorcode],
                  bdata: e,
                  url: S
                }
              };
            m("微信登录异常:" + JSON.stringify(o)), i(o);
          }
        }, function (e) {
          m("请求800登录接口失败" + JSON.stringify(e)), G("请求800登录接口失败" + JSON.stringify(e));
        });
      },
      fail: function (e) {
        G("调用微信原生的登录 fail" + JSON.stringify(e));
        var t = {
          result: "-1",
          msg: "调用微信原生的登录 fail" + JSON.stringify(e),
          data: {
            msg: "调用微信原生的登录 fail 接口调用失败，将无法正常使用开放接口等服务 重启游戏试试看？"
          }
        };
        i(t);
      }
    });
  });
}
c.gotoPrivateMiniProgram = e => {
  console.log("params", e);
  let t = {
    site: e.site ? e.site : B.site,
    url: B.platform_url
  };
  m("p8sdk gotoPrivateMiniProgram 接口调用", t);
  let o = wx.getStorageSync("priAppid"),
    n = t;
  c.gotoSystem(o, n, "pages/webview/webview");
}, c.showSwitchPopup = () => {
  console.log("拉起转端弹窗.......showSwitchPopup"), c.showSwitchGoto = function () {
    console.log("cocos版本", cc.ENGINE_VERSION);
    let e = "portrait" == B.device_orientation ? "https://ksyun.oss-cn-hangzhou.aliyuncs.com/showSwitchPopupTYBG.png" : "https://ksyun.oss-cn-hangzhou.aliyuncs.com/showSwitchPopupTYBGhorizontal.png";
    cc && ("2" == cc.ENGINE_VERSION[0] ? function (e) {
      if (console.info("showCCPopupPage-----contentUrl:", e), !e) return;
      function t(e, t = null) {
        let o = new cc.Node(e);
        return t && (o.parent = t), o;
      }
      let o = t("firstPage");
      o.addComponent(cc.BlockInputEvents), o.zIndex = 999, cc.game.addPersistRootNode(o);
      let n = o.addComponent(cc.Sprite);
      t("tipLabel", o).addComponent(cc.Label).fontSize = 28;
      let i = t("closeBtnNode", o);
      i.zIndex = 9999;
      let r = i.addComponent(cc.Sprite),
        s = "",
        a = "";
      "portrait" == B.device_orientation ? (s = () => {
        console.error("posY:", n._spriteFrame._rect.height), console.error("posX:", n._spriteFrame._rect.width), o.x = 375, o.y = 650;
      }, a = () => {
        i.x = 250, i.y = -150, i.width = 100, i.height = 100;
      }) : (s = () => {
        console.error("posY:", n._spriteFrame._rect.height), console.error("posX:", n._spriteFrame._rect.width), o.x = 375, o.y = 680, o.width = 650, o.height = 300;
      }, a = () => {
        i.x = 250, i.y = -95;
      }), M(r, "https://h5bg.ks3-cn-guangzhou.ksyuncs.com/return.png", a), M(n, e, s), i.on("touchstart", () => {
        o.active = !1;
      }, this);
    }(e) : function e(t, o = 0, n = 20) {
      if (!t) return;
      function i(e, t = null) {
        let o = new cc.Node(e);
        return t && (o.parent = t), o;
      }
      let r = cc.director.getScene();
      if (o >= n) fail && fail(new Error("达到的最大重试次数:showCCPopupPageNew"));else if (r) {
        let e = r.getChildByName("Canvas") ? r.getChildByName("Canvas") : r.getChildByName("CanvasTest"),
          o = e.getContentSize();
        console.log("canvasSize", o);
        let n = o.width / 10,
          s = o.height / 10;
        console.log("aPosx", n), console.log("aPosy", s);
        let a = i("firstPage");
        a.addComponent(cc.BlockInputEventsComponent), e.addChild(a), a.layer = 33554432;
        let c = a.addComponent(cc.Sprite),
          l = "https://h5bg.ks3-cn-guangzhou.ksyuncs.com/return.png",
          d = i("closeBtnNode", a);
        d.layer = 33554442;
        let u = d.addComponent(cc.Sprite),
          p = "",
          g = "";
        "portrait" == B.device_orientation ? (p = () => {
          a.setPosition(0, 0);
        }, g = () => {
          d.setPosition(250, -150), d.setContentSize(100, 100);
        }) : (p = () => {
          a.getComponent(cc.UITransformComponent).setContentSize(o.x / 1.2, o.y - 40), a.setPosition(0, 35);
        }, g = () => {
          let e = 3.5 * n,
            t = 2.9 * s,
            o = .7 * n;
          d.setPosition(e, -t), d.setContentSize(o, o);
        }), U(c, t, p, e), U(u, l, g, e), d.on(cc.Node.EventType.TOUCH_START, () => {
          a.active = !1;
        }, this);
      } else setTimeout(() => {
        e(t, o + 1, n);
      }, 1e3);
    }(e));
  }, setTimeout(() => {
    console.log("调用.......showSwitchGoto"), c.showSwitchGoto();
  }, 100);
}, c.showBoxPopup = (e, t) => {
  console.log("拉起小盒子弹窗.......showBoxPopup", e, t), c.showBoxGoto = function () {
    console.log("cocos版本", cc.ENGINE_VERSION);
    let o = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/parisBg.png";
    cc && ("2" == cc.ENGINE_VERSION[0] ? function (e, t = {}) {
      if (console.info("showCCBoxPage-----contentUrl:", e), !e) return;
      let o = [];
      if (!B.gameBoxData || 0 == B.gameBoxData.length) return void console.error("盒子无数据,请查看后台是否配置...");
      for (let e = 0; e < B.gameBoxData.length; e++) if (B.gameBoxData[e].app_id != B.appid) {
        let t = {
          ...B.gameBoxData[e],
          game_name: B.gameBoxData[e].game_name.slice(0, 6)
        };
        o.push(t);
      }
      function n(e, t = null) {
        let o = new cc.Node(e);
        return t && (o.parent = t), o;
      }
      o.length > 9 && (o = o.slice(0, 9)), console.log("boxList", o);
      let i = n("firstPage");
      i.addComponent(cc.BlockInputEvents);
      let r = i.addComponent(cc.Widget);
      r.isAlignVerticalCenter = !0, r.isAlignHorizontalCenter = !0, i.zIndex = 999, cc.game.addPersistRootNode(i);
      let s = i.addComponent(cc.Sprite),
        a = n("closeBtnNode", i);
      a.zIndex = 9999;
      let l = a.addComponent(cc.Sprite),
        d = "",
        u = "";
      if ("portrait" == B.device_orientation) {
        let e = "",
          t = "",
          n = "",
          r = "";
        o.length <= 2 && (e = 300, t = 150, n = 660, r = 260), o.length > 2 && o.length <= 6 && (e = 600, t = 280, n = 810, r = 320), o.length > 6 && (e = 900, n = 810, r = 320, t = 400), d = () => {
          console.error("posY:", s._spriteFrame._rect.height), console.error("posX:", s._spriteFrame._rect.width), i.width = n, i.y = 650, i.height = e;
        }, u = () => {
          a.x = r, a.y = t, a.width = 75, a.height = 75;
        };
      } else {
        let e = "",
          t = "",
          n = "",
          r = "";
        o.length <= 2 && (e = 300, n = 350, r = 140, t = 130), o.length > 2 && o.length <= 6 && (e = 300, n = 430, r = 170, t = 130), o.length > 6 && (e = 340, n = 430, r = 170, t = 150), d = () => {
          console.error("posY:", s._spriteFrame._rect.height), console.error("posX:", s._spriteFrame._rect.width), i.width = n, i.y = 670, i.height = e;
        }, u = () => {
          a.x = r, a.y = t, a.width = 40, a.height = 40;
        };
      }
      let p = 0,
        g = 0,
        h = -1;
      for (let e = 0; e < o.length; e++) {
        let r = n("baseImgNode" + e, i);
        r.zIndex = 9997;
        let s = r.addComponent(cc.Sprite),
          a = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/iconBg.png",
          l = n("imgNode" + e, i);
        l.zIndex = 9998;
        let d = l.addComponent(cc.Sprite),
          u = n("lbBaseNode" + e, i);
        u.zIndex = 9999;
        let f = u.addComponent(cc.Sprite),
          m = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/labelBg.png",
          y = n("imgTitleNode" + e, i);
        y.zIndex = 9999;
        let _ = y.addComponent(cc.Label);
        y.color = new cc.Color(0, 0, 0), _.enableBold = !0, _.string = o[e].game_name, "portrait" == B.device_orientation ? _.fontSize = 28 : _.fontSize = 14;
        let v = "";
        M(s, a, v = "portrait" == B.device_orientation ? () => {
          r.width = 160, r.height = 160, l.width = 150, l.height = 150, u.width = 210, u.height = 80, 1 == o.length && (l.x = 0, l.y = 0, r.x = 0, r.y = 5, y.x = 0, y.y = -85, u.x = 0, u.y = -75), 2 == o.length && (p = 120, l.x = 2 * e * p - p, l.y = 0, r.x = 2 * e * p - p, r.y = 5, y.x = 2 * e * p - p, y.y = -85, u.x = 2 * e * p - p, u.y = -75), 3 == o.length && (p = 120, g = 115, e <= 1 && (l.x = 2 * e * p - p, l.y = g, r.x = 2 * e * p - p, r.y = g + 5, y.x = 2 * e * p - p, y.y = 140 - g, u.x = 2 * e * p - p, u.y = 150 - g), e > 1 && (l.x = -p, l.y = -g, r.x = -p, r.y = 5 - g, y.x = -p, y.y = 140 - g - g - g, u.x = -p, u.y = 150 - g - g - g)), 4 == o.length && (p = 120, g = 115, e <= 1 && (l.x = 2 * e * p - p, l.y = g, r.x = 2 * e * p - p, r.y = g + 5, y.x = 2 * e * p - p, y.y = 140 - g, u.x = 2 * e * p - p, u.y = 150 - g), e > 1 && (2 == e && (h = 0), 3 == e && (h = 1), l.x = 2 * h * p - p, l.y = -g, r.x = 2 * h * p - p, r.y = 5 - g, y.x = 2 * h * p - p, y.y = 140 - g - g - g, u.x = 2 * h * p - p, u.y = 150 - g - g - g)), o.length > 4 && o.length <= 6 && (p = 200, g = 115, e <= 2 && (l.x = e * p - p, l.y = g, r.x = e * p - p, r.y = g + 5, y.x = e * p - p, y.y = 140 - g, u.x = e * p - p, u.y = 150 - g), e > 2 && e <= 5 && (3 == e && (h = 0), 4 == e && (h = 1), 5 == e && (h = 2), l.x = h * p - p, l.y = -g, r.x = h * p - p, r.y = 5 - g, y.x = h * p - p, y.y = 140 - g - g - g, u.x = h * p - p, u.y = 150 - g - g - g)), o.length > 6 && (p = 200, g = 240, e <= 2 && (l.x = e * p - p, l.y = g, r.x = e * p - p, r.y = g + 5, y.x = e * p - p, y.y = g - 85, u.x = e * p - p, u.y = g - 75), e > 2 && e <= 5 && (3 == e && (h = 0), 4 == e && (h = 1), 5 == e && (h = 2), l.x = h * p - p, l.y = g - g, r.x = h * p - p, r.y = g - g + 5, y.x = h * p - p, y.y = g - 85 - g, u.x = h * p - p, u.y = g - 75 - g), e > 5 && (6 == e && (h = 0), 7 == e && (h = 1), 8 == e && (h = 2), l.x = h * p - p, l.y = g - g - g, r.x = h * p - p, r.y = g - g - g + 5, y.x = h * p - p, y.y = g - 85 - g - g, u.x = h * p - p, u.y = g - 75 - g - g));
        } : () => {
          r.width = 78, r.height = 78, l.width = 75, l.height = 75, u.width = 110, u.height = 40, 1 == o.length && (l.x = 0, l.y = 0, r.x = 0, r.y = 3, y.x = 0, y.y = -58, u.x = 0, u.y = -40), 2 == o.length && (p = 70, l.x = 2 * e * p - p, l.y = 0, r.x = 2 * e * p - p, r.y = 3, y.x = 2 * e * p - p, y.y = -58, u.x = 2 * e * p - p, u.y = -40), 3 == o.length && (p = 70, g = 70, e <= 1 && (l.x = 2 * e * p - p, l.y = g, r.x = 2 * e * p - p, r.y = g + 3, y.x = 2 * e * p - p, y.y = 80 - g, u.x = 2 * e * p - p, u.y = 98 - g), e > 1 && (l.x = -p, l.y = -g, r.x = -p, r.y = 3 - g, y.x = -p, y.y = 80 - g - g - g, u.x = -p, u.y = 98 - g - g - g)), 4 == o.length && (p = 70, g = 70, e <= 1 && (l.x = 2 * e * p - p, l.y = g, r.x = 2 * e * p - p, r.y = g + 3, y.x = 2 * e * p - p, y.y = 80 - g, u.x = 2 * e * p - p, u.y = 98 - g), e > 1 && (2 == e && (h = 0), 3 == e && (h = 1), l.x = 2 * h * p - p, l.y = -g, r.x = 2 * h * p - p, r.y = 3 - g, y.x = 2 * h * p - p, y.y = 80 - g - g - g, u.x = 2 * h * p - p, u.y = 98 - g - g - g)), o.length > 4 && o.length <= 6 && (p = 105, g = 70, e <= 2 && (l.x = e * p - p, l.y = g, r.x = e * p - p, r.y = g + 3, y.x = e * p - p, y.y = 80 - g, u.x = e * p - p, u.y = 98 - g), e > 2 && e <= 5 && (3 == e && (h = 0), 4 == e && (h = 1), 5 == e && (h = 2), l.x = h * p - p, l.y = -g, r.x = h * p - p, r.y = 3 - g, y.x = h * p - p, y.y = 80 - g - g - g, u.x = h * p - p, u.y = 98 - g - g - g)), o.length > 6 && (p = 105, g = 90, e <= 2 && (l.x = e * p - p, l.y = g, r.x = e * p - p, r.y = g + 3, y.x = e * p - p, y.y = g - 56, u.x = e * p - p, u.y = g - 39), e > 2 && e <= 5 && (3 == e && (h = 0), 4 == e && (h = 1), 5 == e && (h = 2), l.x = h * p - p, l.y = g - g, r.x = h * p - p, r.y = g - g + 3, y.x = h * p - p, y.y = g - 56 - g, u.x = h * p - p, u.y = g - 39 - g), e > 5 && (6 == e && (h = 0), 7 == e && (h = 1), 8 == e && (h = 2), l.x = h * p - p, l.y = g - g - g, r.x = h * p - p, r.y = g - g - g + 3, y.x = h * p - p, y.y = g - 56 - g - g, u.x = h * p - p, u.y = g - 39 - g - g));
        }), M(f, m, v), M(d, o[e].icon, v), l.on("touchstart", e => {
          console.log("e", e);
          let n = e.target._name[e.target._name.length - 1],
            i = Object.assign({}, t, {
              key: "123"
            }),
            r = o[n].app_id,
            s = o[n].sort;
          c.gotoSystemCustom(r, i, "active", s), J("click", s);
        }, this);
      }
      M(l, "https://ksyun.oss-cn-hangzhou.aliyuncs.com/redCloseBtn.png", u), M(s, e, d), J("click", "999"), a.on("touchstart", () => {
        i.active = !1;
      }, this);
    }(o, e) : function e(t, o = {}, n = {}, i = 0, r = 20) {
      if (!t) return;
      let s = [];
      if (!B.gameBoxData || 0 == B.gameBoxData.length) return void console.error("盒子无数据,请查看后台是否配置...");
      for (let e = 0; e < B.gameBoxData.length; e++) if (B.gameBoxData[e].app_id != B.appid) {
        let t = {
          ...B.gameBoxData[e],
          game_name: B.gameBoxData[e].game_name.slice(0, 6)
        };
        s.push(t);
      }
      function a(e, t = null) {
        let o = new cc.Node(e);
        return t && (o.parent = t), o;
      }
      s.length > 9 && (s = s.slice(0, 9)), console.log("boxList", s);
      let l = cc.director.getScene();
      if (i >= r) fail && fail(new Error("达到的最大重试次数:showCCBoxPageNew"));else if (l) {
        let e = l.getChildByName("Canvas") ? l.getChildByName("Canvas") : l.getChildByName("CanvasTest"),
          n = e.getContentSize();
        console.log("canvasSize", n), cc.view.getDesignResolutionSize();
        let i = n.width / 10,
          r = n.height / 10;
        console.log("aPosx", i), console.log("aPosy", r);
        let d = a("firstPage");
        d.addComponent(cc.BlockInputEventsComponent), e.addChild(d), d.layer = 33554432;
        let u = d.addComponent(cc.Sprite),
          p = d.addComponent(cc.Widget);
        p.isAlignVerticalCenter = !0, p.isAlignHorizontalCenter = !0;
        let g = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/redCloseBtn.png",
          h = a("closeBtnNode", d);
        h.layer = 33554442;
        let f = h.addComponent(cc.Sprite),
          m = "",
          y = "";
        if ("portrait" == B.device_orientation) {
          let e = "",
            t = "";
          s.length <= 2 && (e = 4, t = 1.1), s.length > 2 && s.length <= 6 && (e = 3, t = 1.5), s.length > 6 && (e = 2, t = 2.2), m = () => {
            d.getComponent(cc.UITransformComponent).setContentSize(n.x, n.y / e), d.setPosition(0, 0);
          }, y = () => {
            let e = 4 * i,
              o = t * r,
              n = 1 * i;
            h.setPosition(e, o), h.getComponent(cc.UITransformComponent).setContentSize(n, n);
          };
        } else {
          let e = "",
            t = "",
            o = "",
            i = "";
          s.length <= 2 && (e = 1.4, t = 3, o = 700, i = 2.8), s.length > 2 && s.length <= 6 && (e = 1.1, t = 3.6, o = 500, i = 3), s.length > 6 && (e = 1, t = 3.9, o = 300, i = 3.6), m = () => {
            d.getComponent(cc.UITransformComponent).setContentSize(n.y / e, n.y - o), d.setPosition(0, 0);
          }, y = () => {
            let e = t * r,
              o = i * r,
              n = 1 * r;
            h.setPosition(e, o), h.getComponent(cc.UITransformComponent).setContentSize(n, n);
          };
        }
        let _ = 0,
          v = 0,
          w = 0,
          S = -1,
          C = 0,
          x = 0;
        for (let t = 0; t < s.length; t++) {
          let n = a("baseImgNode" + t, d);
          n.layer = 33554432;
          let l = n.addComponent(cc.Sprite),
            u = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/iconBg.png",
            p = a("imgNode" + t, d);
          p.layer = 33554443;
          let g = p.addComponent(cc.Sprite),
            h = a("lbBaseNode" + t, d);
          h.layer = 33554433;
          let f = h.addComponent(cc.Sprite),
            m = "https://ksyun.oss-cn-hangzhou.aliyuncs.com/labelBg.png",
            y = a("imgTitleNode" + t, d);
          y.layer = 33554442;
          let P = y.addComponent(cc.Label);
          P.isBold = !0, P.color = new cc.Color(0, 0, 0), P.string = s[t].game_name;
          let b = "";
          U(l, u, b = "portrait" == B.device_orientation ? () => {
            s.length > 6 && (_ = 2.5 * i, v = 1.4 * r, w = 150, C = 160, x = 150, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 7, t <= 2 && (p.setPosition(t * _ - _, v), n.setPosition(t * _ - _, v + 5), h.setPosition(t * _ - _, v - w / 2), y.setPosition(t * _ - _, v - w / 2)), t > 2 && t <= 5 && (3 == t && (S = 0), 4 == t && (S = 1), 5 == t && (S = 2), p.setPosition(S * _ - _, v - v), n.setPosition(S * _ - _, v - v + 5), h.setPosition(S * _ - _, v - w / 2 - v), y.setPosition(S * _ - _, v - w / 2 - v)), t > 5 && (6 == t && (S = 0), 7 == t && (S = 1), 8 == t && (S = 2), p.setPosition(S * _ - _, v - v - v), n.setPosition(S * _ - _, v - v - v + 5), h.setPosition(S * _ - _, v - w / 2 - v - v), y.setPosition(S * _ - _, v - w / 2 - v - v))), s.length > 4 && s.length <= 6 && (_ = 2.5 * i, v = .7 * r, w = 150, C = 160, x = 150, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 7, t <= 2 && (p.setPosition(t * _ - _, v), n.setPosition(t * _ - _, v + 5), h.setPosition(t * _ - _, w - v), y.setPosition(t * _ - _, w - v)), t > 2 && t <= 5 && (3 == t && (S = 0), 4 == t && (S = 1), 5 == t && (S = 2), p.setPosition(S * _ - _, v - v - v + 30), n.setPosition(S * _ - _, v - v - v + 35), h.setPosition(S * _ - _, w - v - v - v + 30), y.setPosition(S * _ - _, w - v - v - v + 30))), 4 == s.length && (_ = 1 * r, v = .8 * r, w = 1 * r, C = 1.1 * r, x = 1 * r, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 6, t <= 1 && (p.setPosition(2 * t * _ - _, v), n.setPosition(2 * t * _ - _, v + 5), h.setPosition(2 * t * _ - _, w - v), y.setPosition(2 * t * _ - _, w - v)), t > 1 && (2 == t && (S = 0), 3 == t && (S = 1), p.setPosition(2 * S * _ - _, v - v - v + 30), n.setPosition(2 * S * _ - _, v - v - v + 35), h.setPosition(2 * S * _ - _, w - v - v - v + 30), y.setPosition(2 * S * _ - _, w - v - v - v + 30))), 1 == s.length && (_ = 2.3 * i, v = 1.5 * r, w = 1 * r, C = 1.1 * r, x = 1 * r, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 6, p.setPosition(0, 0), n.setPosition(0, 5), h.setPosition(0, -r / 2), y.setPosition(0, -r / 2)), 2 == s.length && (_ = 1 * r, v = .3 * r, w = 1 * r, C = 1.1 * r, x = 1 * r, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 6, p.setPosition(2 * t * _ - _, 0), n.setPosition(2 * t * _ - _, 5), h.setPosition(2 * t * _ - _, -r / 2), y.setPosition(2 * t * _ - _, -r / 2)), 3 == s.length && (_ = 1 * r, v = .8 * r, w = 1 * r, C = 1.1 * r, x = 1 * r, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = r / 6, t <= 1 && (p.setPosition(2 * t * _ - _, v), n.setPosition(2 * t * _ - _, v + 5), h.setPosition(2 * t * _ - _, w - v), y.setPosition(2 * t * _ - _, w - v)), t > 1 && (S++, p.setPosition(-_, v - v - v + 30), n.setPosition(-_, v - v - v + 35), h.setPosition(-_, w - v - v - v + 30), y.setPosition(-_, w - v - v - v + 30), 2 == S && (S = -1)));
          } : () => {
            1 == s.length && (_ = 2.3 * i, v = 1.5 * r, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, p.setPosition(0, 0), n.setPosition(0, 5), h.setPosition(0, -150), y.setPosition(0, -150)), 2 == s.length && (_ = 250, v = 80, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, p.setPosition(2 * t * _ - _, 0), n.setPosition(2 * t * _ - _, 5), h.setPosition(2 * t * _ - _, -150), y.setPosition(2 * t * _ - _, -150)), 3 == s.length && (_ = 320, v = 250, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, t <= 1 && (p.setPosition(2 * t * _ - _, v), n.setPosition(2 * t * _ - _, v + 5), h.setPosition(2 * t * _ - _, v - 150), y.setPosition(2 * t * _ - _, v - 150)), t > 1 && (p.setPosition(-_, v - v - v), n.setPosition(-_, v - v - v + 5), h.setPosition(-_, v - v - v - 150), y.setPosition(-_, v - v - v - 150))), 4 == s.length && (_ = 320, v = 250, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, t <= 1 && (p.setPosition(2 * t * _ - _, v), n.setPosition(2 * t * _ - _, v + 5), h.setPosition(2 * t * _ - _, v - 150), y.setPosition(2 * t * _ - _, v - 150)), t > 1 && (2 == t && (S = 0), 3 == t && (S = 1), p.setPosition(2 * S * _ - _, v - v - v), n.setPosition(2 * S * _ - _, v - v - v + 5), h.setPosition(2 * S * _ - _, v - v - v - 150), y.setPosition(2 * S * _ - _, v - v - v - 150))), s.length > 4 && s.length <= 6 && (_ = 380, v = 250, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, t <= 2 && (p.setPosition(t * _ - _, v), n.setPosition(t * _ - _, v + 5), h.setPosition(t * _ - _, v - 150), y.setPosition(t * _ - _, v - 150)), t > 2 && t <= 5 && (3 == t && (S = 0), 4 == t && (S = 1), 5 == t && (S = 2), p.setPosition(S * _ - _, v - v - v), n.setPosition(S * _ - _, v - v - v + 5), h.setPosition(S * _ - _, v - v - v - 150), y.setPosition(S * _ - _, v - v - v - 150))), s.length > 6 && (_ = 430, v = 365, w = 300, C = 320, x = 300, p.getComponent(cc.UITransformComponent).setContentSize(w, w), n.getComponent(cc.UITransformComponent).setContentSize(C, C), h.getComponent(cc.UITransformComponent).setContentSize(1.2 * x, x / 2), P.fontSize = 48, t <= 2 && (p.setPosition(t * _ - _, v), n.setPosition(t * _ - _, v + 5), y.setPosition(t * _ - _, v - 150), h.setPosition(t * _ - _, v - 150)), t > 2 && t <= 5 && (3 == t && (S = 0), 4 == t && (S = 1), 5 == t && (S = 2), p.setPosition(S * _ - _, v - v), n.setPosition(S * _ - _, v - v + 5), h.setPosition(S * _ - _, v - v - 150), y.setPosition(S * _ - _, v - v - 150)), t > 5 && (6 == t && (S = 0), 7 == t && (S = 1), 8 == t && (S = 2), p.setPosition(S * _ - _, v - v - v), n.setPosition(S * _ - _, v - v - v), h.setPosition(S * _ - _, v - v - v - 150), y.setPosition(S * _ - _, v - v - v - 150)));
          }, e), U(f, m, b, e), U(g, s[t].icon, b, e), p.on(cc.Node.EventType.TOUCH_START, e => {
            console.log("e", e);
            let t = e.target._name[e.target._name.length - 1],
              n = Object.assign({}, o, {
                key: "123"
              }),
              i = s[t].app_id,
              r = s[t].sort;
            c.gotoSystemCustom(i, n, "active", r), J("click", r);
          }, this);
        }
        U(f, g, y, e), U(u, t, m, e), J("click", "999"), h.on(cc.Node.EventType.TOUCH_START, () => {
          d.active = !1;
        }, this);
      } else setTimeout(() => {
        e(t, o, n, i = 0, r = 20);
      }, 1e3);
    }(o, e, t));
  }, setTimeout(() => {
    console.log("调用.......showBoxGoto"), c.showBoxGoto();
  }, 100);
}, c.getOnlySwitch = e => {
  if (console.log("调用.......", e), console.error("开关37 uid ....", B.uid), console.error("开关37 uid type ....", typeof B.uid), !e) return wx.showModal({
    title: "少传参数了",
    content: "sid(服务器id)为必传参数",
    duration: 0,
    success: () => {
      console.log("success ..........");
    }
  }), void console.error("必须要传入服务器id ---\x3e sid");
  let t = parseInt(new Date().getTime() / 1e3),
    o = {
      site: B.site,
      types: "37",
      time: t,
      uid: B.uid,
      aid: B.aid,
      sid: e
    },
    n = j(o);
  o.sign = y(n), console.log("开关请求参数 obj", o), h(B.platform_url + "/switch/switchListS", "post", o, e => {
    let t = e.data;
    if (t && 0 === t.result) {
      let e = t.data;
      if (console.error("请求到list数据", JSON.stringify(t)), e[37].s) {
        F("canShow");
        let t = e[37].timespan;
        c.showGoto = function () {
          let t = e[37].content;
          t = "https://h5bg.ks3-cn-guangzhou.ksyuncs.com/tswcbyy.png", A("https://h5bg.ks3-cn-guangzhou.ksyuncs.com/tswcbyy.png");
        }, setTimeout(() => {
          console.log("调用.......showGoto"), c.showGoto(), F("showIng");
        }, 1e3 * t);
      }
    } else console.error("请求switchList数据失败", t);
  }, e => {
    console.error("请求switchList数据异常", e);
  });
}, c.getTemplate_ids = function () {
  return d;
}, c.subscribeMessage = function (e) {
  let t = [];
  return m("p8sdk 微信消息订阅 接口调用", d), e && m("p8sdk 微信消息订阅 自定义传参 接口调用", e), new Promise(o => {
    t = e || d, console.log("tmplIds", t), wx.requestSubscribeMessage({
      tmplIds: t,
      success: e => {
        m("微信消息订阅窗口弹出 ", e);
        let n = "";
        for (let o = 0; o < t.length; o++) {
          let i = t[o];
          "accept" == e[i] && (n += i + ",");
        }
        n = n.substring(0, n.length - 1);
        let i = parseInt(new Date().getTime() / 1e3),
          r = {
            site: B.site,
            aid: B.aid,
            template_id: n,
            open_id: B.openid,
            uid: B.uid,
            time: i
          },
          s = j(r);
        r.sign = y(s);
        let a = B.platform_url + "/oauth/getWxSubscription";
        m("请求 订阅消息请求url ", a), m("请求 订阅消息请求参数 ", r);
        let c = {
          wxres: e
        };
        g(a, "GET", r, e => {
          c.p8res = e, m("订阅消息请求 返回data", e), o(c);
        }, e => {
          m("订阅消息请求 失败返回data", e), c.p8res = e, o(c);
        });
      },
      fail(e) {
        let t = {
          wxres: e
        };
        console.error("微信消息订阅窗口弹出异常:", e), o(t);
      }
    });
  });
}, c.getSubscriptionsSetting = function (e) {
  m("p8sdk 查询订阅消息", arguments);
  let t = new Promise(e => {
    let t = parseInt(new Date().getTime() / 1e3),
      o = {
        site: B.site,
        uid: B.uid,
        time: t
      },
      n = j(o);
    o.sign = y(n);
    let i = B.platform_url + "/oauth/getUserWxSubscriptionId",
      r = i + "?" + te(o);
    m("请求 查询订阅消息请求url ", i), m("请求 查询订阅消息请求参数 ", o), m("请求 查询订阅消息请求参数拼接url: ", r), g(i, "GET", o, t => {
      m("查询订阅消息请求 成功返回data", t), e(t.data);
    }, t => {
      m("查询订阅消息请求 失败返回data", t), e(t.data);
    });
  });
  return t;
}, c.delSubscribeMessage = function (e) {
  m("p8sdk 取消订阅消息", arguments);
  let t = new Promise(t => {
    let o = parseInt(new Date().getTime() / 1e3),
      n = e.join(",");
    console.log("temId", n);
    let i = {
        site: B.site,
        uid: B.uid,
        template_id: n,
        time: o
      },
      r = j(i);
    i.sign = y(r);
    let s = B.platform_url + "/oauth/delUserWxSubscriptionId",
      a = s + "?" + te(i);
    m("请求 取消订阅消息请求url ", s), m("请求 取消订阅消息请求参数 ", i), m("请求 取消订阅消息请求参数拼接url: ", a), g(s, "GET", i, e => {
      m("取消订阅消息请求 成功返回data", e);
      let o = {
        result: 0,
        data: {
          msg: "取消成功",
          res: JSON.stringify(e)
        }
      };
      t(o);
    }, e => {
      m("取消订阅消息请求 失败返回data", e);
      let o = {
        result: 1,
        data: {
          msg: "取消失败",
          res: JSON.stringify(e)
        }
      };
      t(o);
    });
  });
  return t;
}, c.gotoCustomerServiceConversation = function (e) {
  c.showCustomerServicePage ? c.showCustomerServicePage() : (m("p8sdk 微信消息订阅 接口调用", e), e && void 0 !== e.showMessageCard || ((e = {}).showMessageCard = !1), e.fail || (e.fail = () => {
    m("p8 sdk调用客服 fail");
  }), e.complete || (e.complete = () => {
    m("p8 sdk调用客服 complete");
  }), wx.openCustomerServiceConversation({
    showMessageCard: e.showMessageCard,
    sendMessageTitle: e.sendMessageTitle,
    sendMessagePath: e.sendMessagePath,
    sendMessageImg: e.sendMessageImg,
    success: e.success,
    fail: e.fail,
    complete: e.complete
  }));
}, wx.onHide(function () {
  let e = new Date().getTime();
  Math.abs(D - e) < 1e4 && g(`${B.platform_url}/oauth/wechat/${B.appid}?MsgType=wxToH5&openid=${B.device}&site=${B.site}&aid=${B.aid}`, "GET", "", () => {
    m("进入微信后台上报成功");
  });
});
var R = !1;
function G(e = "null") {
  let t = {
    str: e,
    time: parseInt(new Date().getTime() / 1e3),
    openid: x
  };
  g(B.platform_url + "/sdk_callback/setLog", "POST", t, function (e) {
    m("上报打点日志成功", t), (e = e.data).result;
  });
}
function F(e = "null") {
  let t = {
    log: "tip_show_log",
    isip: !0,
    str: e,
    time: parseInt(new Date().getTime() / 1e3)
  };
  console.error("上报的数据是", t), h(B.platform_url + "/sdk_callback/setLog", "POST", t, function (e) {
    m("上报打点日志成功", t), (e = e.data).result;
  });
}
function J(e = "null", t = "-1") {
  let o = parseInt(new Date().getTime() / 1e3),
    n = {
      site: B.site,
      box_id: B.box_id,
      uid: B.uid,
      lattice: t,
      type: e,
      time: o
    },
    i = j(n);
  n.sign = y(i), m("盒子日志上报的数据: ", n);
  let r = B.platform_url + "/log/jumpLog";
  m("请求 盒子上报打点日志拼接url: ", r + "?" + te(n)), f(r, "GET", n, function (e) {
    0 == (e = e.data).result ? m("盒子上报打点日志成功success: ", n) : m("盒子上报打点日志失败fail: " + JSON.stringify(e));
  });
}
function W(e) {
  return wx.getStorageSync(e);
}
function L(e, t) {
  wx.setStorageSync(e, t);
}
function j(e) {
  let t = B.key;
  m("新的加密方式请求数据sdkData.key", t);
  var o = [];
  for (var n in e) o.push(n);
  o = o.sort();
  for (var i = "", r = 0; r < o.length; r++) {
    var s = e[o[r]];
    r != o.length - 1 ? i += o[r] + "=" + s + "&" : i += o[r] + "=" + s;
  }
  return e.site + i + t;
}
function X(e) {
  K(e);
  var t = [];
  for (var o in e) t.push(o);
  t = t.sort();
  let n = "";
  for (let o = 0; o < t.length; o++) {
    const i = e[t[o]];
    n += t[o] + i;
  }
  return n;
}
function K(e) {
  for (let t in e) e.hasOwnProperty(t) && void 0 === e[t] && (e[t] = "");
}
function q() {
  let e = W("oldOrderInfo");
  e && ((e = JSON.parse(e)).mac = "1", new Promise((e, t) => {
    g(B.platform_url + "/oauth/getMidasBalance", "GET", {
      site: B.site,
      uid: B.uid,
      openid: B.openid,
      version: B.mdsVersion
    }, function (o) {
      let n = S(o);
      if (0 == n.result) {
        let t = n.data.balance;
        console.log("balance:", t), e(t);
      }
      console.error("请求米大师余额查询 返回的数据", o), t(null);
    }, function (e) {
      console.error("请求米大师余额查询异常 msg", e), t(null);
    });
  }).then(t => {
    let o = S(t);
    if (0 == o.result) {
      let t = o.data.balance;
      console.log("balance:", t), t >= 6 && V(e);
    } else console.log("请求米大师余额查询异常");
  }).catch(() => {
    console.log("请求米大师余额查询失败");
  }));
}
function V(e) {
  var t = {
      env: e.env,
      money: e.money,
      offer_id: s.offerId,
      order_id: e.order_id,
      appid: B.appid,
      openid: B.device,
      site: B.site,
      mac: e.mac ? e.mac : "0",
      scale: s.scale,
      zone_id: s.zoneId,
      b_site: u.b_site,
      pf: "android",
      version: B.mdsVersion,
      time: parseInt(new Date().getTime() / 1e3)
    },
    o = "";
  for (let e in t) o += "&" + e + "=" + t[e] ? t[e] : "";
  o = o.substring(1);
  var n = y(`${B.site}${o}${B.key}`);
  return t.sign = n, console.log("p8---\x3e notifyData 扣款 ", t), new Promise(e => {
    g(B.rg_url + "/midas/notify", "POST", t, () => {
      e({
        result: 0,
        data: {
          errorcode: "0",
          msg: "付款成功！"
        }
      });
    }, t => {
      var o = {
        result: 1,
        data: {
          errorcode: "1",
          msg: JSON.stringify(t)
        }
      };
      e(o);
    });
  });
}
function Y(e) {
  return new Promise(t => {
    let o = B.b_site ? B.b_site : B.site,
      n = parseInt(new Date().getTime() / 1e3);
    var i = {
      cp_order_id: e.cp_order_id,
      money: e.money,
      product_name: e.product_name,
      productid: e.productid,
      roleid: e.roleid,
      rolename: e.rolename,
      serverid: e.serverid,
      level: e.level,
      ext: e.ext,
      aid: B.aid,
      udid: B.device,
      uid: B.uid,
      time: n,
      site: o,
      ip: ""
    };
    let r = re(oe(i));
    i.sign = r, m("支付请求参数", i);
    let s = B.rg_url + "/h/pN/wx";
    console.log(s), m("支付请求Url: ", s + "?" + te(i)), g(s, "GET", i, e => {
      t({
        result: 0,
        data: e
      });
    }, e => {
      t({
        result: 1,
        data: e
      });
    });
  });
}
c.SuspensionBtn = function () {
  function e(e, t) {
    let o = new cc.Node(e);
    return t && (o.parent = t), o;
  }
  m("调用生成悬浮窗"), R = !0;
  var t = wx.getSystemInfoSync().windowWidth,
    o = wx.getSystemInfoSync().windowHeight,
    n = 375 / t,
    i = 812 / o;
  let r = e("moveButton");
  r.zIndex = 100;
  let s = r.addComponent(cc.Sprite);
  r.addComponent(cc.Button), r.setContentSize(80 / n, 80 / i), M(s, "/800img/bg.png"), s.sizeMode = cc.Sprite.SizeMode.CUSTOM, cc.game.addPersistRootNode(r), r.setPosition(50, o);
  let a,
    c = e("xuanfukuang", r),
    l = c.addComponent(cc.Sprite);
  M(l, "/hswl/p8SDK-img/%E6%9B%B4%E5%A4%9A.png"), c.addComponent(cc.Button), c.setContentSize(80 / n, 80 / i), l.sizeMode = cc.Sprite.SizeMode.CUSTOM, c.on("touchstart", () => {
    a = !1;
  }, this), c.on("touchmove", e => {
    a = !0, r.x = e.currentTouch._point.x, r.y = e.currentTouch._point.y;
  }, this), c.on("touchend", () => {
    r.y <= 40 ? r.y = 50 : r.y >= 2 * o - 80 / i && (r.y = 2 * o - 20 - 80 / i), a || (d.active = !d.active);
  }, this);
  let d = e("layout", r),
    u = d.addComponent(cc.Sprite);
  M(u, "/hswl/20211026104715.png"), d.setContentSize(200 / n, 250 / i), u.sizeMode = cc.Sprite.SizeMode.CUSTOM, d.setPosition(150 / n, -40 / i), d.active = !1;
  let p = e("shoujiButton", d),
    h = p.addComponent(cc.Sprite);
  p.addComponent(cc.Button), p.setContentSize(45 / n, 45 / i), M(h, "/hswl/p8SDK-img/%E6%89%8B%E6%9C%BA.png"), h.sizeMode = cc.Sprite.SizeMode.CUSTOM, p.setPosition(-40, 43 / i);
  let f = e("label2", p);
  f.color = new cc.color().fromHEX("#9F9F9F"), f.setPosition(0, -50 / i), creatorlabel("label2", "#9F9F9F", p, 0, -50 / i, "手机", 22 / i);
  var _ = !1,
    v = !1;
  let w = e("binding");
  p.on("click", () => {
    if (0 == _ && 0 == v) {
      _ = !0, v = !0, w.addComponent(cc.BlockInputEvents), w.zIndex = 90, cc.game.addPersistRootNode(w), w.setContentSize(cc.director.getWinSizeInPixels().width, cc.director.getWinSizeInPixels().height), w.setPosition(cc.director.getWinSizeInPixels().width / 2, cc.director.getWinSizeInPixels().height / 2);
      let o = w.addComponent(cc.Sprite);
      M(o, "/800img/1108.png"), o.sizeMode = cc.Sprite.SizeMode.CUSTOM;
      let r = cc.director.getWinSizeInPixels().height / 1560;
      creatorlabel("shoujihao", "#0D0D0D", w, -250 / n, 400 * r, "手 机 号 :"), creatorlabel("yanzhengma", "#0D0D0D", w, -250 / n, 280 * r, "验 证 码 :"), creatorlabel("mima", "#0D0D0D", w, -250 / n, 100 * r, "密       码:"), creatorlabel("quedingmima", "#0D0D0D", w, -250 / n, 0 * r, "确认密码:"), creatorlabel("quedingmima", "#0D0D0D", w, 0, -350 * r, "绑定后，您可以使用手机号登陆app客户端");
      let s = creatorlabel("success", "#E82C2C", w, 0, -400 * r, "请 输 入 您 的 手 机 号", 28),
        a = creatorlabel("success", "#E82C2C", w, 0, -150 * r, "该账号以绑定过了", 28);
      a.node.active = !1;
      let c = creatorlabel("success", "#E82C2C", w, 0, -150 * r, "请 输 入 验 证 码", 28);
      c.node.active = !1;
      let l = creatorlabel("success", "#E82C2C", w, 0, -200 * r, "并设置最少大于6位的密码", 28);
      l.node.active = !1;
      let d = e("EditBox1", w);
      d.setPosition(0 / n, 400 * r), d.setContentSize(300 / n, 100 / i);
      let u = d.addComponent(cc.EditBox),
        p = creatorlabel("textlabel", "#8E8888", d, 0, 0, "手机号");
      d.on("editing-did-began", () => {
        p.string = "|";
      }), d.on("text-changed", () => {
        p.string = u.string;
      }), d.on("editing-did-ended", () => {
        0 == u.string.length ? p.string = "手机号" : p.string = u.string;
      });
      var t = creatorlabel("daojishi", "#0D0D0D", w, 280 / n, 400 * r, "60");
      let h = 60;
      t.node.active = !1;
      let f = e("jurisdiction1", w);
      f.setContentSize(180 / n, 120 / i), f.setPosition(260 / n, 400 * r);
      let S = f.addComponent(cc.Sprite);
      M(S, "/hswl/bindingimg/20211102-154359.png"), S.sizeMode = cc.Sprite.SizeMode.CUSTOM, f.addComponent(cc.Button), f.on("click", () => {
        if (f.active = !1, t.node.active = !0, (h = 60) >= 0 && setInterval(function () {
          h >= 1 && 1 == t.node.active ? (h -= 1, t.string = h) : (t.node.active = !1, f.active = !0);
        }, 500), 11 == p.string.length) {
          s.node.active = !1;
          let e = parseInt(new Date().getTime() / 1e3),
            t = {
              site: B.site,
              time: e,
              mobile: u.string,
              sendtype: "bind"
            },
            o = X(t);
          t.sign = y(o);
          let n = function (e) {
            let o = e.data.data;
            0 == o.status ? (a.node.active = !1, m("未绑定手机号,获取授权成功", o), g(B.platform_url + "/api/sendmobilecode", "GET", t, function (e) {
              m("验证码已经发送", e), 0 == e.data.result && (c.node.active = !0, l.node.active = !0);
            })) : (m("请输入正确的手机号"), a.node.active = !0);
          };
          g(B.platform_url + "/api/newcheckbind", "GET", t, n);
        }
      }, this);
      let C = e("EditBox2", w);
      C.setPosition(0 / n, 280 * r), C.setContentSize(300 / n, 100 / i);
      let x = C.addComponent(cc.EditBox),
        P = creatorlabel("textlabel", "#8E8888", C, 0, 0, "验证码");
      C.on("editing-did-began", () => {
        P.string = "|";
      }), C.on("text-changed", () => {
        P.string = x.string;
      }), C.on("editing-did-ended", () => {
        0 == x.string.length ? P.string = "验证码" : P.string = x.string;
      });
      let b = e("EditBox3", w);
      b.setPosition(0 / n, 100 * r), b.setContentSize(300 / n, 100 / i);
      let k = b.addComponent(cc.EditBox),
        z = creatorlabel("textlabel", "#8E8888", b, 0, 0, "请输入密码");
      b.on("editing-did-began", () => {
        z.string = "|";
      }), b.on("text-changed", () => {
        z.string = k.string;
      }), b.on("editing-did-ended", () => {
        0 == k.string.length ? z.string = "请输入密码" : z.string = k.string;
      });
      let I = e("EditBox4", w);
      I.setPosition(0, 0), I.setContentSize(300 / n, 100 / i);
      let T = I.addComponent(cc.EditBox),
        D = creatorlabel("textlabel", "#8E8888", I, 0, 0, "确认密码");
      I.on("editing-did-began", () => {
        D.string = "|";
      }), I.on("text-changed", () => {
        D.string = T.string;
      }), I.on("editing-did-ended", () => {
        0 == T.string.length ? D.string = "确认密码" : D.string = T.string;
      });
      let E = e("jurisdiction2", w);
      E.setContentSize(600 / n, 120 / i), E.setPosition(0 / n, -500 * r);
      let A = E.addComponent(cc.Sprite);
      M(A, "/hswl/bindingimg/20211102-154422.png"), A.sizeMode = cc.Sprite.SizeMode.CUSTOM, E.addComponent(cc.Button);
      let N = {
        account: B.account,
        password: B.password,
        site: B.site,
        time: "",
        mobile: "",
        code: "",
        newpassword: ""
      };
      E.on("click", () => {
        N.time = parseInt(new Date().getTime() / 1e3), N.mobile = u.string, N.code = x.string, N.newpassword = k.string;
        let e = X(N);
        N.sign = y(e), T.string.length == k.string.length && T.string.length >= 6 && 11 == u.string.length && 5 == x.string.length ? g(B.platform_url + "/api/newbindmobile", "GET", N, function (e) {
          0 == e.data.result ? (c.node.active = !1, l.string = "提 交 成 功", E.active = !1, setTimeout(function () {
            w.active = !1;
          }, 2e3)) : 1 == e.data.result && (l.node.active = !0, c.node.active = !1, l.string = e.data.data.msg, setTimeout(function () {
            l.node.active = !1;
          }, 2e3));
        }) : m("提交失败"), m("binding", w);
      }, this);
    } else 1 == _ && 1 == v ? (w.active = !1, _ = !1) : 0 == _ && 1 == v && (w.active = !0, _ = !0);
  }, this);
  let S = e("shoujiButton", d),
    C = S.addComponent(cc.Sprite);
  S.addComponent(cc.Button), S.setContentSize(45 / n, 45 / i), M(C, "/hswl/p8SDK-img/%E6%89%8B%E6%B8%B8.png"), C.sizeMode = cc.Sprite.SizeMode.CUSTOM, S.setPosition(40, 43 / i), creatorlabel("label3", "#9F9F9F", S, 0, -50 / i, "升级", 22 / i), S.on("click", () => {
    wx.showModal({
      title: "超值福利领取",
      content: "下载并使用手机版游戏即可享受:\n\n✨✨【纵享流畅体验,减少卡顿闪退问题】✨✨\n\n✨【福利满满的高价值礼包等你来兑换】✨\n\n限时福利，机不可失,千万别错过!\n前往客服回复“礼包”领取手机版",
      cancelText: "残忍拒绝",
      confirmText: "前往客服",
      success(e) {
        e.confirm ? (m("用户点击确定--\x3e 前往客服"), function () {
          let e = new Date().getTime();
          D = e, wx.openCustomerServiceConversation({
            showMessageCard: !0,
            sendMessagePath: "page/index/index?a=b&c=d",
            sendMessageTitle: "回复“礼包”继续",
            sendMessageImg: "https://ks3-cn-shanghai.ksyuncs.com/800img/1109.png"
          });
        }()) : e.cancel && m("用户点击取消--\x3e 残忍拒绝");
      }
    });
  }, this);
}, c.lvcompare = function () {
  let e = parseInt(new Date().getTime() / 1e3),
    t = {
      site: B.site,
      time: e,
      aid: B.aid,
      uid: B.uid
    };
  m("悬浮窗条件查询请求参数", t);
  let o = j(t);
  t.sign = y(o), g(B.platform_url + "/switch/wxFrame", "GET", t, function (e) {
    1 == e.data.data.s && 0 == R ? (m("条件满足，生成悬浮框"), SuspensionBtn()) : m("生成悬浮框条件不满足");
  });
}, c.creatorlabel = function (e = "", t = "", o, n = 0, i = 0, r = "", s) {
  let a = new cc.Node(e);
  t && (a.color = new cc.color().fromHEX(t)), a.setPosition(n, i), a.parent = o;
  let c = a.addComponent(cc.Label);
  return s && (c.fontSize = s), c.string = r, c;
}, c.init = function () {}, c.login = function () {
  return console.log("P8SDK.js  login开始调用: " + C()), new Promise(e => {
    H().then(t => {
      e(t);
    });
  });
}, c.createGameClubButton = function (e) {
  return wx.createGameClubButton({
    type: e.type,
    style: {
      left: e.left,
      top: e.top,
      width: e.width,
      height: e.height
    },
    image: e.image,
    openlink: e.openlink,
    hasRedDot: e.hasRedDot
  });
}, c.getGameClubData = function () {
  return console.log(B), new Promise(e => {
    wx.getGameClubData({
      dataTypeList: [{
        type: 1
      }, {
        type: 3
      }, {
        type: 4
      }, {
        type: 5
      }, {
        type: 6
      }, {
        type: 7
      }, {
        type: 8
      }, {
        type: 9
      }, {
        type: 10
      }],
      success: t => {
        let o = parseInt(new Date().getTime() / 1e3),
          n = {
            site: B.site,
            uid: B.uid,
            iv: t.iv,
            encryptedData: t.encryptedData,
            time: o
          };
        K(n);
        var i = re(oe(n));
        n.sign = i, g(B.platform_url + "/api/wxDataDecode", "get", n, t => {
          if (0 == t.data.result) {
            console.log(1);
            var o = {
              result: 0,
              data: {
                data: t.data.data
              }
            };
            e(o);
          } else o = {
            result: t.data.data.errorcode,
            msg: t.data.data.msg
          }, e(o);
        });
      },
      fail: e => console.error(e)
    });
  });
}, c.requestSubscribeSystemMessage = function (e) {
  wx.requestSubscribeSystemMessage({
    msgTypeList: ["SYS_MSG_TYPE_WHATS_NEW"],
    success(t) {
      e(t);
    }
  });
}, c.gameActionLog = function (e = "-1") {
  let t = {
    action_id: e,
    site: B.site,
    uid: B.uid
  };
  m("游戏行为上报的数据: ", t);
  let o = "https://admin.yyingplay.com/v1/game_action_log";
  m("请求 游戏行为日志上报拼接url: ", o + "?" + te(t)), f(o, "POST", t, e => {
    0 === (e = S(e)).ack ? m("游戏行为日志上报成功success: ", JSON.stringify(e)) : m("游戏行为日志上报异常fail: ", JSON.stringify(e));
  });
}, c.showPayStatus = function (e) {
  return new Promise(t => {
    let o = parseInt(new Date().getTime() / 1e3),
      n = y(B.key + "WX" + B.site + "WX" + o + o),
      i = {
        site: B.site,
        time: o,
        uid: B.uid,
        sign: n,
        version: "2.0.20",
        roleid: e.roleid,
        level: e.level,
        ce: 0,
        vip: !1,
        sid: 1
      },
      r = B.rg_url + "/h/isShowPay";
    Object.assign(i, e), m(" 显示支付入口开关 请求参数", i), g(r, "GET", i, e => {
      m(" 显示支付入口开关 返回参数", e), t(e && e.data);
    }, e => {
      t({
        result: 1,
        data: {
          msg: "微信请求异常 error",
          res: e
        }
      });
    });
  });
}, c.pay = function (e) {
  if (console.log(e), !c.showPayPage) return "1.0" == e.mdsVersion && (B.mdsVersion = "1.0"), console.info("调用P8支付接口"), e.env = 0, console.error("sdk强制米大师支付使用正式环境"), new Promise(t => {
    Y(e).then(o => {
      0 != o.result && t({
        result: -1,
        msg: "下单异常:" + o.data
      });
      let n = o.data;
      n || t({
        result: -1,
        msg: "获取格式错误"
      }), n.data = n.data.data, console.info(" madeOrder 返回内容", JSON.stringify(n.data));
      var i = n.data.orderid;
      if (5 == n.data.paytype) {
        let e = {
          result: 0,
          data: {
            paytype: "5",
            url: n.data.url,
            order_id: i
          }
        };
        t(e);
      } else if (13 == n.data.paytype) q(), function (e) {
        return new Promise(t => {
          let o = {
            env: e.env,
            buyQuantity: e.money * s.scale,
            offerId: s.offerId,
            zoneId: s.zoneId,
            mode: "game",
            currencyType: "CNY",
            platform: "android",
            success: function (e) {
              console.error("米大师支付返回", e), t({
                result: 0,
                data: {
                  errorcode: "",
                  msg: "付款成功！"
                }
              });
            },
            fail: function (o) {
              var n = {
                result: 1,
                data: {
                  errorcode: "",
                  msg: "付款失败！",
                  data: JSON.stringify(o)
                }
              };
              console.error("米大师充值异常:", o);
              let i = {};
              i.g_money = e.money, i.paydata_scale = s.scale;
              let r = "";
              for (const e in i) if (Object.hasOwnProperty.call(i, e)) {
                const t = i[e];
                "success" != e && "fail" != e && "complete" != e && (r += e + ":" + t + "\n");
              }
              console.error("米大师支付参数:", r), t(n);
            }
          };
          wx.requestMidasPayment(o);
        });
      }({
        env: e.env,
        money: e.money
      }).then(o => {
        let n = {
          env: 0,
          money: e.money,
          order_id: i,
          mac: "0"
        };
        V(n).then(() => {
          o.data.paytype = "13", t(o), L("oldOrderInfo", JSON.stringify(n));
        });
      });else if (16 == n.data.paytype) {
        let t = i,
          o = e.roleid,
          n = e.serverid,
          r = e.productid,
          s = e.money,
          a = wx.getStorageSync("extAppid"),
          l = "pages/pay/pay",
          d = {
            gotoPay_order: t,
            gotoPay_character: o,
            gotoPay_area: n,
            gotoPay_goods: r,
            gotoPay_price: s,
            gotoPay_site: B.site
          };
        c.gotoSystem(a, d, l);
      } else if (17 == n.data.paytype) {
        let e = e => {
          if (0 === (e = S(e)).result && e.data && e.data.url) {
            let t = e.data.url;
            console.log("---------sdkData", B), cc && "0" == B.blacklistCode && (console.log("paytype17支付"), "2" == cc.ENGINE_VERSION[0] ? function (e) {
              let t = function (e, t = null) {
                let o = new cc.Node("firstPage");
                return t && (o.parent = t), o;
              }();
              t.addComponent(cc.BlockInputEvents), t.zIndex = 999, cc.game.addPersistRootNode(t);
              let o = t.addComponent(cc.Sprite),
                n = e;
              console.log("codeBtnUrl", n);
              let i = "";
              M(o, n, i = "portrait" == B.device_orientation ? () => {
                t.x = 375, t.y = 667, t.width = 750, t.height = 1664;
              } : () => {
                t.x = 375, t.y = 667, t.width = 220, t.height = 375;
              }), t.on("touchstart", () => {
                t.active = !1;
              }, this);
            }(t) : function e(t, o = 0, n = 20) {
              let i = cc.director.getScene();
              if (o >= n) fail && fail(new Error("达到的最大重试次数:showCCPopupPageNew"));else if (i) {
                let e = i.getChildByName("Canvas") ? i.getChildByName("Canvas") : i.getChildByName("CanvasTest"),
                  o = e.getContentSize();
                console.log("------------canvasSize", o);
                let n = o.width / 10,
                  r = o.height / 10;
                console.log("aPosx", n), console.log("aPosy", r);
                let s = function (e, t = null) {
                  let o = new cc.Node("firstPage");
                  return t && (o.parent = t), o;
                }();
                s.addComponent(cc.BlockInputEventsComponent), s.layer = 33554432, e.addChild(s);
                let a = s.addComponent(cc.Sprite),
                  c = t;
                console.log("codeBtnUrl", c);
                let l = "";
                U(a, c, l = "portrait" == B.device_orientation ? () => {
                  s.setPosition(0, 0), s.getComponent(cc.UITransformComponent).setContentSize(o.x, o.y);
                } : () => {
                  s.getComponent(cc.UITransformComponent).setContentSize(o.x / 3, o.y), s.setPosition(0, 0);
                }, e), s.on(cc.Node.EventType.TOUCH_START, () => {
                  s.active = !1;
                }, this);
              } else setTimeout(() => {
                e(t, o + 1, n);
              }, 1e3);
            }(t));
          } else console.error("加载异常", e);
        };
        g(B.rg_url + "/toPay", "get", {
          pay_type: 17,
          order_id: i
        }, e);
      } else if (28 == n.data.paytype) {
        let e = e => {
          if (0 === (e = S(e)).result && e.data && e.data.img) {
            let o = e.data.img;
            console.log("---------sdkData", B);
            let n = o.replace(/[\r\n]/g, "");
            console.log("img", n);
            var t = "data:image/jpeg;base64," + n;
            console.log("base64Data", t), cc && "0" == B.blacklistCode && (console.log("截图二维码支付"), "2" == cc.ENGINE_VERSION[0] ? N(t) : O(t));
          } else console.error("加载28支付类型异常", e);
        };
        g(B.rg_url + "/toPay", "get", {
          pay_type: 28,
          order_id: i
        }, e);
      } else {
        var r = {
          result: 0,
          data: {
            errorcode: "-1",
            msg: "暂不支持支付 paytype： " + n.data.paytype,
            res: o
          }
        };
        t(r);
      }
    });
  });
  c.showPayPage();
}, c.wxdialog = function (e) {
  return new Promise(t => {
    let o = parseInt(new Date().getTime() / 1e3);
    var n = y(`${B.key}WX${B.site}WX${o}${o}`);
    let i = {
      uid: B.uid,
      site: B.site,
      aid: B.aid,
      level: e.level,
      sign: n,
      time: o
    };
    g(B.platform_url + "/api/wxdialog", "GET", i, e => {
      if (0 == e.data.result) wx.showModal({
        title: "礼包福利",
        content: "下载并使用手机版游戏，即可享受:\n\n1.高价值手机版礼包\n2.沉浸式无干扰游戏体验\n\n限时福利，错过再等一年\n前往客服回复“礼包”领取手机版",
        showCancel: !0,
        cancelText: "残忍拒绝",
        confirmText: "前往客服",
        confirmColor: "#999",
        success(e) {
          if (e.confirm) var o = {
            result: 0,
            data: {
              errorcode: "0",
              msg: "处理成功"
            }
          };else e.cancel && (o = {
            result: 1,
            data: {
              errorcode: "201",
              msg: "用户点击取消"
            }
          });
          t(o);
        }
      });else {
        var o = {
          result: 1,
          data: {
            errorcode: "500",
            msg: e.data.data.msg
          }
        };
        t(o);
      }
    });
  });
}, a.P8SDK = c;
var $ = {};
function Q(e = "{}") {
  let o = parseInt(new Date().getTime() / 1e3),
    n = {
      aid: B.aid,
      device: B.device,
      device_type: B.modeltype,
      ip: B.ip,
      mac: B.mac,
      gameversion: B.gameversion,
      device_model: B.device_model,
      device_resolution: B.device_resolution,
      device_version: B.device_version,
      device_net: B.device_net,
      device_code: B.device_code,
      oaid: e.oaid,
      idfv: e.idfv,
      ext: e.ext,
      media_params: t,
      game_id: B.game_id,
      site: B.site,
      is_model: 1
    };
  K(n);
  let i = {
    event_name: "activate",
    event_time: o,
    data: n
  };
  m("  新SDK模版激活上报请求服务器参数: " + JSON.stringify(i)), ee("https://adv2.play800.cn/sdk/upload", "POST", i, e => {
    m(" 新SDK模版激活返回的数据 res： " + JSON.stringify(e));
  });
}
function Z(e, t = "get", o = null, n = null, i = null) {
  o && m(" 请求参数:  sign: " + o.sign + " site: " + o.site + " time: " + o.time), wx.request({
    url: e,
    method: t,
    data: o,
    header: {
      "content-type": "application/x-www-form-urlencoded"
    },
    success: function (e) {
      n(e);
    },
    fail: function (e) {
      n(e);
    }
  });
}
function ee(e, t = "get", o = null, n = null, i = null) {
  wx.request({
    url: e,
    method: t,
    data: o,
    header: {
      "content-type": "application/json"
    },
    success: function (e) {
      n(e);
    },
    fail: function (e) {
      n(e);
    }
  });
}
function te(e) {
  let t = "";
  for (const o in e) e.hasOwnProperty.call(e, o) && (t += o + "=" + e[o] + "&");
  return t = t.substring(0, t.length - 1), encodeURI(t);
}
function oe(e) {
  var t = [];
  for (var o in e) t.push(o);
  t = t.sort();
  let n = B.site;
  for (let o = 0; o < t.length; o++) {
    const i = e[t[o]];
    n += 0 != o ? "&" + t[o] + "=" + i : t[o] + "=" + i;
  }
  return n + B.key;
}
$.onActiveFunc = function (e) {
  return new Promise(t => {
    let o = parseInt(new Date().getTime() / 1e3),
      n = {
        aid: B.aid,
        site: B.site,
        time: o,
        device: B.device,
        ip: B.ip,
        mac: B.mac,
        modeltype: B.modeltype,
        gameversion: B.gameversion,
        device_model: B.device_model,
        device_resolution: B.device_resolution,
        device_version: B.device_version,
        device_net: B.device_net
      },
      i = oe(n);
    console.log("排序", i);
    var r = re(i);
    n.sign = r;
    let s = B.data_url + "/log/activate";
    m("  激活上报请求服务器参数: " + JSON.stringify(n));
    let a = s + "?" + te(n);
    m("激活上报Url: ", a), Z(a, "GET", n, o => {
      m(" 激活返回的数据 res： " + JSON.stringify(o));
      let n = S(o);
      if (n.result) var i = {
        result: "1",
        data: {
          errorcode: n.data.errorcode,
          msg: n.data.msg
        }
      };else i = {
        result: "0"
      };
      t(i), Q(e);
    });
  });
}, $.pushLoginData = function (e) {
  return console.warn(" =============== 开始登录上报: 传入的数据是 " + JSON.stringify(e)), new Promise(o => {
    let n = parseInt(new Date().getTime() / 1e3),
      i = {
        aid: B.aid,
        uid: B.uid,
        sid: e.sid,
        roleid: e.roleid,
        rolename: e.rolename,
        level: e.level,
        vip: e.vip,
        ip: e.ip,
        onlinetime: e.onlinetime,
        device: B.device,
        modeltype: B.modeltype,
        device_model: B.device_model,
        device_resolution: B.device_resolution,
        device_version: B.device_version,
        device_net: B.device_net,
        oaid: e.oaid,
        site: B.site,
        time: n,
        version: "2.0.20",
        game_type: "mini"
      };
    (function (e) {
      let t = setInterval(() => {
        m("计时器"), function (e) {
          let t = parseInt(new Date().getTime() / 1e3);
          m("***t", t);
          let o = {
            aid: e.aid,
            uid: e.uid,
            site: e.site,
            device: e.device,
            modeltype: e.modeltype,
            username: e.username,
            sid: e.sid,
            roleid: e.roleid,
            rolename: e.rolename,
            level: e.level,
            vip: e.vip,
            ip: e.ip,
            onlinetime: e.onlinetime,
            device_model: e.device_model,
            device_resolution: e.device_resolution,
            device_version: e.device_version,
            device_net: e.device_net,
            time: t,
            oaid: e.oaid
          };
          K(o);
          var n = re(oe(o));
          o.sign = n, Z(B.data_url + "/log/onlineTime", "POST", o, e => {
            m("心跳时间上报= ", S(e));
          });
        }(e);
      }, 3e5);
      m("time =", t);
    })(i), K(i);
    let r = oe(i);
    console.log("nnn", B), console.log("nnn", r);
    var s = re(r);
    i.sign = s;
    let a = B.data_url + "/log/login";
    console.warn(" 登录上报请求服务器参数: ", i);
    let c = a + "?" + te(i);
    console.warn("登录上报请求Url: ", c), Z(c, "get", i, n => {
      let i = S(n);
      if (console.warn("登录返回的数据 是什么 " + JSON.stringify(i)), i.result) var r = {
        result: "1",
        data: {
          errorcode: i.errorcode,
          msg: i.msg
        }
      };else r = {
        result: "0",
        data: {
          errorcode: 200,
          msg: "登录数据上报成功"
        }
      };
      o(r), function (e = "{}") {
        let o = parseInt(new Date().getTime() / 1e3),
          n = {
            aid: B.aid,
            uid: B.uid,
            device: B.device,
            device_type: B.modeltype,
            username: e.username,
            sid: e.sid,
            roleid: e.roleid,
            rolename: e.rolename,
            level: e.level,
            vip: e.vip,
            ip: e.ip,
            device_model: B.device_model,
            device_resolution: B.device_resolution,
            device_version: B.device_version,
            device_net: B.device_net,
            oaid: e.oaid,
            idfv: e.idfv,
            game_type: "mini",
            media_params: t,
            device_code: B.device_code,
            game_id: B.game_id,
            is_model: 1,
            site: B.site,
            version: "2.0.20",
            onlinetime: e.onlinetime
          };
        K(n);
        let i = {
          event_name: "login",
          event_time: o,
          data: n
        };
        m("  新SDK模版登录上报请求服务器参数: " + JSON.stringify(i)), ee("https://adv2.play800.cn/sdk/upload", "POST", i, e => {
          m(" 新SDK模版登录返回的数据 res： " + JSON.stringify(e));
        });
      }(e);
    });
  });
}, $.incomeLog = function (e) {
  m(" =============== 开始充值上报: 传入的数据是 " + JSON.stringify(e)), e || (e = {
    username: "username",
    sid: "sid",
    roleid: "roleid",
    rolename: "rolename",
    level: "level",
    device_type: "device",
    order_id: "order_id",
    ip: "ip",
    income_channel: "income_channel",
    income_currency: "income_currency",
    income_money: "income_money",
    income_gold: "income_gold",
    own_gold: "own_gold",
    income_status: "income_status"
  }), e.key = B.key, e.site = B.site;
  let o = parseInt(new Date().getTime() / 1e3);
  return new Promise(n => {
    let i = {
      site: B.site,
      key: B.key,
      aid: B.aid,
      time: o,
      uid: B.uid,
      username: e.username,
      sid: e.sid,
      roleid: e.roleid,
      rolename: e.rolename,
      level: e.level,
      device_type: B.openid,
      order_id: e.order_id,
      ip: e.ip,
      income_channel: e.income_channel,
      income_currency: e.income_currency,
      income_money: e.income_money,
      income_gold: e.income_gold,
      own_gold: e.own_gold,
      income_status: e.income_status
    };
    K(i);
    var r = re(oe(i));
    i.sign = r, m("  开始充值上报所有参数 " + JSON.stringify(i));
    let s = B.data_url + "/log/income_log";
    m("  开始充值上报url " + s), Z(s, "GET", i, o => {
      var i = S(o);
      0 == i.result ? n({
        msg: i.msg ? i.msg : "成功",
        result: i.result
      }) : n({
        data: i,
        result: i.result
      }), function (e = "{}") {
        let o = parseInt(new Date().getTime() / 1e3),
          n = {
            uid: B.uid,
            site: B.site,
            version: "2.0.20",
            order_id: e.order_id,
            aid: B.aid,
            roleid: e.roleid,
            rolename: e.rolename,
            sid: e.sid,
            money: e.income_money,
            device: B.device,
            mac: B.mac,
            device_type: B.modeltype,
            username: e.username,
            device_model: B.device_model,
            vip: e.vip,
            currency_type: e.income_currency,
            media_params: t,
            device_code: B.device_code,
            game_id: B.game_id,
            is_model: 1,
            key: B.key,
            level: e.level,
            ip: e.ip,
            income_channel: e.income_channel,
            income_gold: e.income_gold,
            own_gold: e.own_gold,
            income_status: e.income_status
          };
        K(n);
        let i = {
          event_name: "user_pay",
          event_time: o,
          data: n
        };
        m("  新SDK模版充值上报请求服务器参数: " + JSON.stringify(i)), ee("https://adv2.play800.cn/sdk/upload", "POST", i, e => {
          m(" 新SDK模版充值返回的数据 res： " + JSON.stringify(e));
        });
      }(e);
    });
  });
}, $.wxVideoLog = function (e) {
  return console.log(" =============== 开始微信广告上报: 数据是 " + JSON.stringify(e)), new Promise(o => {
    let n = ["ad_slot", "ad_unit_id", "type", "status"];
    for (let t = 0; t < n.length; t++) {
      let i = n[t];
      e[i] || o({
        code: -1,
        res: i + "必须要传"
      });
    }
    let r = parseInt(new Date().getTime() / 1e3),
      s = {
        site: B.site,
        aid: B.aid,
        time: r,
        device_type: B.platform,
        sid: e.sid,
        uid: B.uid,
        device: B.device,
        roleid: e.roleid,
        rolename: e.rolename,
        level: e.level,
        game_type: "mini",
        ad_slot: e.ad_slot,
        ad_unit_id: e.ad_unit_id,
        type: e.type,
        status: e.status
      };
    K(s);
    var a = re(oe(s));
    s.sign = a;
    let c = B.data_url + "/log/wxRewardedAd";
    console.log(" 微信广告上报参数: " + JSON.stringify(s));
    let l = c + "?" + te(s);
    console.log("newUrl: ", l), Z(l, "get", s, n => {
      console.log(" 广告返回的数据 res： " + JSON.stringify(n));
      let r = S(n);
      if (r.result) var s = {
        result: "1",
        data: {
          errorcode: r.data.errorcode,
          msg: r.data.msg
        }
      };else s = {
        result: "0"
      };
      o(s), function (e = "{}") {
        let o = ["ad_slot", "ad_unit_id", "type", "status"];
        for (let t = 0; t < o.length; t++) if (!e[o[t]]) return;
        let n = parseInt(new Date().getTime() / 1e3),
          r = {
            site: B.site,
            aid: B.aid,
            sid: e.sid,
            uid: B.uid,
            device_type: B.platform,
            device: B.device,
            ip: B.ip,
            roleid: e.roleid,
            rolename: e.rolename,
            level: e.level,
            game_type: "mini",
            ad_slot: e.ad_slot,
            ad_unit_id: e.ad_unit_id,
            ad_type: e.type,
            ad_status: e.status,
            username: e.username,
            device_model: B.device_model,
            vip: e.vip,
            ad_show_time: i,
            ad_bid: "1",
            media_params: t,
            device_code: B.device_code,
            game_id: B.game_id,
            is_model: 1
          };
        K(r);
        var s = re(oe(r));
        r.sign = s;
        let a = {
          event_name: "ad_show",
          event_time: n,
          data: r
        };
        m("  新SDK模版广告上报请求服务器参数: " + JSON.stringify(a)), ee("https://adv2.play800.cn/sdk/upload", "POST", a, e => {
          m(" 新SDK模版广告返回的数据 res： " + JSON.stringify(e)), i = 1;
        });
      }(e);
    });
  });
}, $.signLog = function (e) {
  m(" =============== 开始创角上报: 传入的数据是 " + JSON.stringify(e)), K(e);
  let o = e;
  return (o = e ? {
    sid: e.sid,
    roleid: e.roleid,
    rolename: e.rolename,
    level: e.level,
    gameversion: B.gameversion,
    uid: B.uid,
    device: B.device,
    modeltype: B.modeltype,
    mac: B.mac,
    ip: B.ip,
    device_model: B.device_model,
    device_resolution: B.device_resolution,
    device_version: B.device_version,
    device_net: B.device_net
  } : {
    sid: "sid",
    uid: "147258",
    roleid: "roleid",
    rolename: "rolename",
    device: "device",
    modeltype: "modeltype",
    mac: "mac",
    level: "level",
    gameversion: "gameversion",
    ip: "ip",
    device_model: "device_model",
    device_resolution: "device_resolution",
    device_version: "device_version",
    device_net: "device_net"
  }).game_type = "mini", new Promise(n => {
    let i = parseInt(new Date().getTime() / 1e3);
    o.site = B.site, o.time = i, o.aid = B.aid, K(o);
    var r = re(oe(o));
    o.sign = r;
    let s = B.data_url + "/log/role";
    m("  创角上报请求服务器参数: " + JSON.stringify(o));
    let a = s + "?" + te(o);
    m("创角上报请求Url: ", a), Z(a, "GET", o, o => {
      let i = S(o);
      if (m("创角返回的数据 是什么 " + JSON.stringify(i)), 0 == i.result) {
        m("创角数据上报成功 ");
        var r = {
          result: "0",
          data: {
            errorcode: i.errorcode,
            msg: i.msg
          }
        };
      } else m("创角数据上报失败"), r = {
        result: "1",
        data: {
          errorcode: 200,
          msg: "创角数据上报失败"
        }
      };
      n(r), function (e = "{}") {
        let o = parseInt(new Date().getTime() / 1e3),
          n = {
            aid: B.aid,
            uid: B.uid,
            device: B.device,
            device_type: B.modeltype,
            username: e.username,
            sid: e.sid,
            roleid: e.roleid,
            rolename: e.rolename,
            level: e.level,
            vip: e.vip,
            ip: B.ip,
            device_model: B.device_model,
            device_resolution: B.device_resolution,
            device_version: B.device_version,
            device_net: B.device_net,
            oaid: e.oaid,
            idfv: e.idfv,
            game_type: "mini",
            media_params: t,
            device_code: B.device_code,
            game_id: B.game_id,
            is_model: 1,
            gameversion: B.gameversion,
            mac: B.mac
          };
        K(n);
        let i = {
          event_name: "role_create",
          event_time: o,
          data: n
        };
        m("  新SDK模版创角上报请求服务器参数: " + JSON.stringify(i)), ee("https://adv2.play800.cn/sdk/upload", "POST", i, e => {
          m(" 新SDK模版创角返回的数据 res： " + JSON.stringify(e));
        });
      }(e);
    });
  });
}, $.upGradeRecord = function (e) {
  return m(" =============== 开始升级上报: 传入的数据是 " + JSON.stringify(e)), new Promise(t => {
    let o = parseInt(new Date().getTime() / 1e3),
      n = {
        aid: B.aid,
        uid: B.uid,
        device: B.device,
        modeltype: B.modeltype,
        sid: e.sid,
        roleid: e.roleid,
        rolename: e.rolename,
        level: e.level,
        vip: e.vip,
        ip: B.ip,
        onlinetime: e.onlinetime,
        device_model: B.device_model,
        device_resolution: B.device_resolution,
        device_version: B.device_version,
        device_net: B.device_net,
        oaid: e.oaid,
        site: B.site,
        time: o,
        version: "2.0.20"
      };
    K(n);
    var i = re(oe(n));
    n.sign = i;
    let r = B.data_url + "/log/level";
    m("升级上报请求服务器的参数: " + JSON.stringify(n));
    let s = r + "?" + te(n);
    m("升级上报请求Url: ", s), Z(s, "GET", n, e => {
      let o = S(e);
      if (m("升级数据上报返回的数据 是什么 " + JSON.stringify(o)), o.result) var n = {
        result: "1",
        data: {
          errorcode: o.errorcode,
          msg: o.msg
        }
      };else n = {
        result: "0",
        data: {
          errorcode: 200,
          msg: "升级数据上报成功"
        }
      };
      t(n);
    });
  });
};
var ne,
  ie = ie || {};
ie.Security = ie.Security || {}, (ne = ie.Security).maxExactInt = Math.pow(2, 53), ne.toUtf8ByteArr = function (e) {
  for (var t, o = [], n = 0; n < e.length; n++) if (55296 <= (t = e.charCodeAt(n)) && t <= 56319 && (t = 1024 * (t - 55296) + (e.charCodeAt(n + 1) - 56320) + 65536, n++), t <= 127) o[o.length] = t;else if (t <= 2047) o[o.length] = 192 + (t >>> 6), o[o.length] = 63 & t | 128;else if (t <= 65535) o[o.length] = 224 + (t >>> 12), o[o.length] = t >>> 6 & 63 | 128, o[o.length] = 63 & t | 128;else {
    if (!(t <= 1114111)) throw "Unicode standart supports code points up-to U+10FFFF";
    o[o.length] = 240 + (t >>> 18), o[o.length] = t >>> 12 & 63 | 128, o[o.length] = t >>> 6 & 63 | 128, o[o.length] = 63 & t | 128;
  }
  return o;
}, ne.toHex32 = function (e) {
  2147483648 & e && (e &= 2147483647, e += Math.pow(2, 31));
  for (var t = e.toString(16); t.length < 8;) t = "0" + t;
  return t;
}, ne.reverseBytes = function (e) {
  var t = 0;
  return t += e >>> 24 & 255, t += (e >>> 16 & 255) << 8, (t += (e >>> 8 & 255) << 16) + ((255 & e) << 24);
}, ne.leftRotate = function (e, t) {
  return e << t | e >>> 32 - t;
}, ne.md5 = function (e) {
  for (var t = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21], o = [], n = 0; n <= 63; n++) o[n] = Math.abs(Math.sin(n + 1)) * Math.pow(2, 32) << 0;
  var i,
    r,
    s = 1732584193,
    a = 4023233417,
    c = 2562383102,
    l = 271733878;
  i = ne.toUtf8ByteArr(e), e = null, r = i.length, i.push(128);
  for (var d = Math.abs(448 - 8 * i.length % 512) / 8; d--;) i.push(0);
  for (i.push(8 * r & 255, 8 * r >> 8 & 255, 8 * r >> 16 & 255, 8 * r >> 24 & 255), n = 4; n--;) i.push(0);
  for (var u = ne.leftRotate, p = (n = 0, []); n < i.length;) {
    for (var g = 0; g <= 15; g++) p[g] = (i[n + 4 * g] << 0) + (i[n + 4 * g + 1] << 8) + (i[n + 4 * g + 2] << 16) + (i[n + 4 * g + 3] << 24);
    var h,
      f,
      m = s,
      y = a,
      _ = c,
      v = l;
    for (g = 0; g <= 63; g++) {
      g <= 15 ? (h = y & _ | ~y & v, f = g) : g <= 31 ? (h = v & y | ~v & _, f = (5 * g + 1) % 16) : g <= 47 ? (h = y ^ _ ^ v, f = (3 * g + 5) % 16) : (h = _ ^ (y | ~v), f = 7 * g % 16);
      var w = v;
      v = _, _ = y, y += u(m + h + o[g] + p[f], t[g]), m = w;
    }
    s = s + m << 0, a = a + y << 0, c = c + _ << 0, l = l + v << 0, n += 64;
  }
  function S(e) {
    return ne.toHex32(ne.reverseBytes(e));
  }
  return S(s) + S(a) + S(c) + S(l);
}, c.callPopupActivity = function (e) {
  return console.log("callPopupActivity", e), new Promise(t => {
    if (!e.actId) return console.error("请传入当前要打开的活动 id"), !1;
    if (GameGlobal.miniGameCommon && GameGlobal.miniGameCommon.createPopupActivity) {
      const o = GameGlobal.miniGameCommon.createPopupActivity();
      let n = {
        actId: e.actId,
        levelList: e.levelList
      };
      o.showPopup(n).then(e => {
        console.log("用户想要购买的商品:", e), t({
          result: 0,
          data: e
        });
      }).catch(e => {
        console.warn("关闭/出错返回:", e), t({
          result: 1,
          data: e
        });
      });
    } else console.error("商业组件不存在,未配置或者未申请权限");
  });
}, c.callPopupActivityPay = function (e) {
  return console.log("callPopupActivityPay", e), new Promise(t => {
    if (GameGlobal.miniGameCommon && GameGlobal.miniGameCommon.createPopupActivity) {
      const o = GameGlobal.miniGameCommon.createPopupActivity();
      if (c.showPayPage) return void c.showPayPage();
      "1.0" == e.mdsVersion && (B.mdsVersion = "1.0"), console.info("调用P8支付接口"), e.env = 0, console.error("sdk强制米大师支付使用正式环境"), Y(e).then(n => {
        0 != n.result && t({
          result: -1,
          msg: "下单异常:" + n.data
        });
        let i = n.data;
        i || t({
          result: -1,
          msg: "获取格式错误"
        }), i.data = i.data.data, console.info(" madeOrder 返回内容", JSON.stringify(i.data));
        var r = i.data.orderid;
        q(), console.log("paydata", s);
        const a = {
          env: e.env,
          offerId: s.offerId,
          buyQuantity: e.money * s.scale,
          outTradeNo: r,
          exchangeRate: s.scale,
          zoneId: s.zoneId,
          mode: "game",
          currencyType: "CNY",
          platform: "android"
        };
        console.log("requestMidasPaymentOption", a);
        let c = {
          env: 0,
          money: e.money,
          order_id: r,
          mac: "0"
        };
        o.requestMidasPayment(a).then(e => {
          console.log("用户支付成功:", e);
          let o = {
            result: 0,
            data: {
              errorcode: "",
              msg: "付款成功！",
              data: JSON.stringify(e)
            }
          };
          V(c).then(() => {
            t(o), L("oldOrderInfo", JSON.stringify(c));
          });
        }).catch(o => {
          console.warn("支付取消/出错:", o);
          var n = {
            result: 1,
            data: {
              errorcode: "",
              errCode: o.errCode,
              msg: o.errMsg,
              data: JSON.stringify(o)
            }
          };
          if (console.error("米大师充值异常:", o), -1 == o.errCode) {
            let t = {};
            t.g_money = e.money, t.paydata_scale = s.scale;
            let o = "";
            for (const e in t) if (Object.hasOwnProperty.call(t, e)) {
              const n = t[e];
              "success" != e && "fail" != e && "complete" != e && (o += e + ":" + n + "\n");
            }
            console.error("米大师支付参数:", o);
          }
          V(c).then(() => {
            t(n), L("oldOrderInfo", JSON.stringify(c));
          });
        });
      });
    } else console.error("商业组件不存在,未配置或者未申请权限");
  });
};
function re(e) {
  return function (e) {
    for (var t, o = "0123456789abcdef", n = "", i = 0; i < e.length; i++) t = e.charCodeAt(i), n += o.charAt(t >>> 4 & 15) + o.charAt(15 & t);
    return n;
  }(function (e) {
    return function (e) {
      for (var t = "", o = 0; o < 32 * e.length; o += 8) t += String.fromCharCode(e[o >> 5] >>> o % 32 & 255);
      return t;
    }(function (e, t) {
      e[t >> 5] |= 128 << t % 32, e[14 + (t + 64 >>> 9 << 4)] = t;
      for (var o = 1732584193, n = -271733879, i = -1732584194, r = 271733878, s = 0; s < e.length; s += 16) {
        var a = o,
          c = n,
          l = i,
          d = r;
        o = ae(o, n, i, r, e[s + 0], 7, -680876936), r = ae(r, o, n, i, e[s + 1], 12, -389564586), i = ae(i, r, o, n, e[s + 2], 17, 606105819), n = ae(n, i, r, o, e[s + 3], 22, -1044525330), o = ae(o, n, i, r, e[s + 4], 7, -176418897), r = ae(r, o, n, i, e[s + 5], 12, 1200080426), i = ae(i, r, o, n, e[s + 6], 17, -1473231341), n = ae(n, i, r, o, e[s + 7], 22, -45705983), o = ae(o, n, i, r, e[s + 8], 7, 1770035416), r = ae(r, o, n, i, e[s + 9], 12, -1958414417), i = ae(i, r, o, n, e[s + 10], 17, -42063), n = ae(n, i, r, o, e[s + 11], 22, -1990404162), o = ae(o, n, i, r, e[s + 12], 7, 1804603682), r = ae(r, o, n, i, e[s + 13], 12, -40341101), i = ae(i, r, o, n, e[s + 14], 17, -1502002290), o = ce(o, n = ae(n, i, r, o, e[s + 15], 22, 1236535329), i, r, e[s + 1], 5, -165796510), r = ce(r, o, n, i, e[s + 6], 9, -1069501632), i = ce(i, r, o, n, e[s + 11], 14, 643717713), n = ce(n, i, r, o, e[s + 0], 20, -373897302), o = ce(o, n, i, r, e[s + 5], 5, -701558691), r = ce(r, o, n, i, e[s + 10], 9, 38016083), i = ce(i, r, o, n, e[s + 15], 14, -660478335), n = ce(n, i, r, o, e[s + 4], 20, -405537848), o = ce(o, n, i, r, e[s + 9], 5, 568446438), r = ce(r, o, n, i, e[s + 14], 9, -1019803690), i = ce(i, r, o, n, e[s + 3], 14, -187363961), n = ce(n, i, r, o, e[s + 8], 20, 1163531501), o = ce(o, n, i, r, e[s + 13], 5, -1444681467), r = ce(r, o, n, i, e[s + 2], 9, -51403784), i = ce(i, r, o, n, e[s + 7], 14, 1735328473), o = le(o, n = ce(n, i, r, o, e[s + 12], 20, -1926607734), i, r, e[s + 5], 4, -378558), r = le(r, o, n, i, e[s + 8], 11, -2022574463), i = le(i, r, o, n, e[s + 11], 16, 1839030562), n = le(n, i, r, o, e[s + 14], 23, -35309556), o = le(o, n, i, r, e[s + 1], 4, -1530992060), r = le(r, o, n, i, e[s + 4], 11, 1272893353), i = le(i, r, o, n, e[s + 7], 16, -155497632), n = le(n, i, r, o, e[s + 10], 23, -1094730640), o = le(o, n, i, r, e[s + 13], 4, 681279174), r = le(r, o, n, i, e[s + 0], 11, -358537222), i = le(i, r, o, n, e[s + 3], 16, -722521979), n = le(n, i, r, o, e[s + 6], 23, 76029189), o = le(o, n, i, r, e[s + 9], 4, -640364487), r = le(r, o, n, i, e[s + 12], 11, -421815835), i = le(i, r, o, n, e[s + 15], 16, 530742520), o = de(o, n = le(n, i, r, o, e[s + 2], 23, -995338651), i, r, e[s + 0], 6, -198630844), r = de(r, o, n, i, e[s + 7], 10, 1126891415), i = de(i, r, o, n, e[s + 14], 15, -1416354905), n = de(n, i, r, o, e[s + 5], 21, -57434055), o = de(o, n, i, r, e[s + 12], 6, 1700485571), r = de(r, o, n, i, e[s + 3], 10, -1894986606), i = de(i, r, o, n, e[s + 10], 15, -1051523), n = de(n, i, r, o, e[s + 1], 21, -2054922799), o = de(o, n, i, r, e[s + 8], 6, 1873313359), r = de(r, o, n, i, e[s + 15], 10, -30611744), i = de(i, r, o, n, e[s + 6], 15, -1560198380), n = de(n, i, r, o, e[s + 13], 21, 1309151649), o = de(o, n, i, r, e[s + 4], 6, -145523070), r = de(r, o, n, i, e[s + 11], 10, -1120210379), i = de(i, r, o, n, e[s + 2], 15, 718787259), n = de(n, i, r, o, e[s + 9], 21, -343485551), o = ue(o, a), n = ue(n, c), i = ue(i, l), r = ue(r, d);
      }
      return Array(o, n, i, r);
    }(function (e) {
      for (var t = Array(e.length >> 2), o = 0; o < t.length; o++) t[o] = 0;
      for (o = 0; o < 8 * e.length; o += 8) t[o >> 5] |= (255 & e.charCodeAt(o / 8)) << o % 32;
      return t;
    }(e), 8 * e.length));
  }(function (e) {
    return unescape(encodeURI(e));
  }(e)));
}
function se(e, t, o, n, i, r) {
  return ue(function (e, t) {
    return e << t | e >>> 32 - t;
  }(ue(ue(t, e), ue(n, r)), i), o);
}
function ae(e, t, o, n, i, r, s) {
  return se(t & o | ~t & n, e, t, i, r, s);
}
function ce(e, t, o, n, i, r, s) {
  return se(t & n | o & ~n, e, t, i, r, s);
}
function le(e, t, o, n, i, r, s) {
  return se(t ^ o ^ n, e, t, i, r, s);
}
function de(e, t, o, n, i, r, s) {
  return se(o ^ (t | ~n), e, t, i, r, s);
}
function ue(e, t) {
  var o = (65535 & e) + (65535 & t);
  return (e >> 16) + (t >> 16) + (o >> 16) << 16 | 65535 & o;
}
function pe(e, t) {
  var o = e[0],
    n = e[1],
    i = e[2],
    r = e[3];
  o = he(o, n, i, r, t[0], 7, -680876936), r = he(r, o, n, i, t[1], 12, -389564586), i = he(i, r, o, n, t[2], 17, 606105819), n = he(n, i, r, o, t[3], 22, -1044525330), o = he(o, n, i, r, t[4], 7, -176418897), r = he(r, o, n, i, t[5], 12, 1200080426), i = he(i, r, o, n, t[6], 17, -1473231341), n = he(n, i, r, o, t[7], 22, -45705983), o = he(o, n, i, r, t[8], 7, 1770035416), r = he(r, o, n, i, t[9], 12, -1958414417), i = he(i, r, o, n, t[10], 17, -42063), n = he(n, i, r, o, t[11], 22, -1990404162), o = he(o, n, i, r, t[12], 7, 1804603682), r = he(r, o, n, i, t[13], 12, -40341101), i = he(i, r, o, n, t[14], 17, -1502002290), o = fe(o, n = he(n, i, r, o, t[15], 22, 1236535329), i, r, t[1], 5, -165796510), r = fe(r, o, n, i, t[6], 9, -1069501632), i = fe(i, r, o, n, t[11], 14, 643717713), n = fe(n, i, r, o, t[0], 20, -373897302), o = fe(o, n, i, r, t[5], 5, -701558691), r = fe(r, o, n, i, t[10], 9, 38016083), i = fe(i, r, o, n, t[15], 14, -660478335), n = fe(n, i, r, o, t[4], 20, -405537848), o = fe(o, n, i, r, t[9], 5, 568446438), r = fe(r, o, n, i, t[14], 9, -1019803690), i = fe(i, r, o, n, t[3], 14, -187363961), n = fe(n, i, r, o, t[8], 20, 1163531501), o = fe(o, n, i, r, t[13], 5, -1444681467), r = fe(r, o, n, i, t[2], 9, -51403784), i = fe(i, r, o, n, t[7], 14, 1735328473), o = me(o, n = fe(n, i, r, o, t[12], 20, -1926607734), i, r, t[5], 4, -378558), r = me(r, o, n, i, t[8], 11, -2022574463), i = me(i, r, o, n, t[11], 16, 1839030562), n = me(n, i, r, o, t[14], 23, -35309556), o = me(o, n, i, r, t[1], 4, -1530992060), r = me(r, o, n, i, t[4], 11, 1272893353), i = me(i, r, o, n, t[7], 16, -155497632), n = me(n, i, r, o, t[10], 23, -1094730640), o = me(o, n, i, r, t[13], 4, 681279174), r = me(r, o, n, i, t[0], 11, -358537222), i = me(i, r, o, n, t[3], 16, -722521979), n = me(n, i, r, o, t[6], 23, 76029189), o = me(o, n, i, r, t[9], 4, -640364487), r = me(r, o, n, i, t[12], 11, -421815835), i = me(i, r, o, n, t[15], 16, 530742520), o = ye(o, n = me(n, i, r, o, t[2], 23, -995338651), i, r, t[0], 6, -198630844), r = ye(r, o, n, i, t[7], 10, 1126891415), i = ye(i, r, o, n, t[14], 15, -1416354905), n = ye(n, i, r, o, t[5], 21, -57434055), o = ye(o, n, i, r, t[12], 6, 1700485571), r = ye(r, o, n, i, t[3], 10, -1894986606), i = ye(i, r, o, n, t[10], 15, -1051523), n = ye(n, i, r, o, t[1], 21, -2054922799), o = ye(o, n, i, r, t[8], 6, 1873313359), r = ye(r, o, n, i, t[15], 10, -30611744), i = ye(i, r, o, n, t[6], 15, -1560198380), n = ye(n, i, r, o, t[13], 21, 1309151649), o = ye(o, n, i, r, t[4], 6, -145523070), r = ye(r, o, n, i, t[11], 10, -1120210379), i = ye(i, r, o, n, t[2], 15, 718787259), n = ye(n, i, r, o, t[9], 21, -343485551), e[0] = Ce(o, e[0]), e[1] = Ce(n, e[1]), e[2] = Ce(i, e[2]), e[3] = Ce(r, e[3]);
}
function ge(e, t, o, n, i, r) {
  return t = Ce(Ce(t, e), Ce(n, r)), Ce(t << i | t >>> 32 - i, o);
}
function he(e, t, o, n, i, r, s) {
  return ge(t & o | ~t & n, e, t, i, r, s);
}
function fe(e, t, o, n, i, r, s) {
  return ge(t & n | o & ~n, e, t, i, r, s);
}
function me(e, t, o, n, i, r, s) {
  return ge(t ^ o ^ n, e, t, i, r, s);
}
function ye(e, t, o, n, i, r, s) {
  return ge(o ^ (t | ~n), e, t, i, r, s);
}
function _e(e) {
  var t,
    o = [];
  for (t = 0; t < 64; t += 4) o[t >> 2] = e.charCodeAt(t) + (e.charCodeAt(t + 1) << 8) + (e.charCodeAt(t + 2) << 16) + (e.charCodeAt(t + 3) << 24);
  return o;
}
var ve = "0123456789abcdef".split("");
function we(e) {
  for (var t = "", o = 0; o < 4; o++) t += ve[e >> 8 * o + 4 & 15] + ve[e >> 8 * o & 15];
  return t;
}
function Se(e) {
  return function (e) {
    for (var t = 0; t < e.length; t++) e[t] = we(e[t]);
    return e.join("");
  }(function (e) {
    var t,
      o = e.length,
      n = [1732584193, -271733879, -1732584194, 271733878];
    for (t = 64; t <= e.length; t += 64) pe(n, _e(e.substring(t - 64, t)));
    e = e.substring(t - 64);
    var i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
    for (t = 0; t < e.length; t++) i[t >> 2] |= e.charCodeAt(t) << (t % 4 << 3);
    if (i[t >> 2] |= 128 << (t % 4 << 3), t > 55) for (pe(n, i), t = 0; t < 16; t++) i[t] = 0;
    return i[14] = 8 * o, pe(n, i), n;
  }(e));
}
function Ce(e, t) {
  return e + t & 4294967295;
}
if ("5d41402abc4b2a76b9719d911017c592" != Se("hello")) function Ce(e, t) {
  var o = (65535 & e) + (65535 & t);
  return (e >> 16) + (t >> 16) + (o >> 16) << 16 | 65535 & o;
}
Se("hello"), a.P8LogSDK = $, function (e, t) {
  "object" == typeof exports ? wx.CryptoJS = module.exports = exports = t() : "function" == typeof define && define.amd ? define([], t) : wx.CryptoJS = e.CryptoJS = t();
}(this, function () {
  var e,
    t,
    o,
    n,
    i,
    r,
    s,
    a,
    c,
    l,
    d,
    u,
    p,
    g,
    h,
    f,
    m,
    y,
    _,
    v,
    w,
    S,
    C,
    x,
    P,
    B,
    b,
    k,
    z,
    I,
    T,
    D,
    E,
    A,
    N,
    O,
    M,
    U,
    H,
    R = R || function (e) {
      var t;
      if ("undefined" != typeof window && window.crypto && (t = window.crypto), "undefined" != typeof self && self.crypto && (t = self.crypto), !(t = !(t = !(t = "undefined" != typeof globalThis && globalThis.crypto ? globalThis.crypto : t) && "undefined" != typeof window && window.msCrypto ? window.msCrypto : t) && "undefined" != typeof global && global.crypto ? global.crypto : t) && "function" == typeof require) try {
        t = require("crypto");
      } catch (i) {}
      var o = Object.create || function (e) {
        return n.prototype = e, e = new n(), n.prototype = null, e;
      };
      function n() {}
      var i = {},
        r = i.lib = {},
        s = r.Base = {
          extend: function (e) {
            var t = o(this);
            return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
              t.$super.init.apply(this, arguments);
            }), (t.init.prototype = t).$super = this, t;
          },
          create: function () {
            var e = this.extend();
            return e.init.apply(e, arguments), e;
          },
          init: function () {},
          mixIn: function (e) {
            for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
            e.hasOwnProperty("toString") && (this.toString = e.toString);
          },
          clone: function () {
            return this.init.prototype.extend(this);
          }
        },
        a = r.WordArray = s.extend({
          init: function (e, t) {
            e = this.words = e || [], this.sigBytes = null != t ? t : 4 * e.length;
          },
          toString: function (e) {
            return (e || l).stringify(this);
          },
          concat: function (e) {
            var t = this.words,
              o = e.words,
              n = this.sigBytes,
              i = e.sigBytes;
            if (this.clamp(), n % 4) for (var r = 0; r < i; r++) {
              var s = o[r >>> 2] >>> 24 - r % 4 * 8 & 255;
              t[n + r >>> 2] |= s << 24 - (n + r) % 4 * 8;
            } else for (var a = 0; a < i; a += 4) t[n + a >>> 2] = o[a >>> 2];
            return this.sigBytes += i, this;
          },
          clamp: function () {
            var t = this.words,
              o = this.sigBytes;
            t[o >>> 2] &= 4294967295 << 32 - o % 4 * 8, t.length = e.ceil(o / 4);
          },
          clone: function () {
            var e = s.clone.call(this);
            return e.words = this.words.slice(0), e;
          },
          random: function (e) {
            for (var o = [], n = 0; n < e; n += 4) o.push(function () {
              if (t) {
                if ("function" == typeof t.getRandomValues) try {
                  return t.getRandomValues(new Uint32Array(1))[0];
                } catch (e) {}
                if ("function" == typeof t.randomBytes) try {
                  return t.randomBytes(4).readInt32LE();
                } catch (e) {}
              }
              throw new Error("Native crypto module could not be used to get secure random number.");
            }());
            return new a.init(o, e);
          }
        }),
        c = i.enc = {},
        l = c.Hex = {
          stringify: function (e) {
            for (var t = e.words, o = e.sigBytes, n = [], i = 0; i < o; i++) {
              var r = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
              n.push((r >>> 4).toString(16)), n.push((15 & r).toString(16));
            }
            return n.join("");
          },
          parse: function (e) {
            for (var t = e.length, o = [], n = 0; n < t; n += 2) o[n >>> 3] |= parseInt(e.substr(n, 2), 16) << 24 - n % 8 * 4;
            return new a.init(o, t / 2);
          }
        },
        d = c.Latin1 = {
          stringify: function (e) {
            for (var t = e.words, o = e.sigBytes, n = [], i = 0; i < o; i++) {
              var r = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
              n.push(String.fromCharCode(r));
            }
            return n.join("");
          },
          parse: function (e) {
            for (var t = e.length, o = [], n = 0; n < t; n++) o[n >>> 2] |= (255 & e.charCodeAt(n)) << 24 - n % 4 * 8;
            return new a.init(o, t);
          }
        },
        u = c.Utf8 = {
          stringify: function (e) {
            try {
              return decodeURIComponent(escape(d.stringify(e)));
            } catch (e) {
              throw new Error("Malformed UTF-8 data");
            }
          },
          parse: function (e) {
            return d.parse(unescape(encodeURIComponent(e)));
          }
        },
        p = r.BufferedBlockAlgorithm = s.extend({
          reset: function () {
            this._data = new a.init(), this._nDataBytes = 0;
          },
          _append: function (e) {
            "string" == typeof e && (e = u.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
          },
          _process: function (t) {
            var o,
              n = this._data,
              i = n.words,
              r = n.sigBytes,
              s = this.blockSize,
              c = r / (4 * s),
              l = (c = t ? e.ceil(c) : e.max((0 | c) - this._minBufferSize, 0)) * s;
            if (r = e.min(4 * l, r), l) {
              for (var d = 0; d < l; d += s) this._doProcessBlock(i, d);
              o = i.splice(0, l), n.sigBytes -= r;
            }
            return new a.init(o, r);
          },
          clone: function () {
            var e = s.clone.call(this);
            return e._data = this._data.clone(), e;
          },
          _minBufferSize: 0
        }),
        g = (r.Hasher = p.extend({
          cfg: s.extend(),
          init: function (e) {
            this.cfg = this.cfg.extend(e), this.reset();
          },
          reset: function () {
            p.reset.call(this), this._doReset();
          },
          update: function (e) {
            return this._append(e), this._process(), this;
          },
          finalize: function (e) {
            return e && this._append(e), this._doFinalize();
          },
          blockSize: 16,
          _createHelper: function (e) {
            return function (t, o) {
              return new e.init(o).finalize(t);
            };
          },
          _createHmacHelper: function (e) {
            return function (t, o) {
              return new g.HMAC.init(e, o).finalize(t);
            };
          }
        }), i.algo = {});
      return i;
    }(Math);
  function G(e, t, o) {
    return e & t | ~e & o;
  }
  function F(e, t, o) {
    return e & o | t & ~o;
  }
  function J(e, t) {
    return e << t | e >>> 32 - t;
  }
  function W(e, t, o, n) {
    var i,
      r = this._iv;
    r ? (i = r.slice(0), this._iv = void 0) : i = this._prevBlock, n.encryptBlock(i, 0);
    for (var s = 0; s < o; s++) e[t + s] ^= i[s];
  }
  function L(e) {
    var t, o, n;
    return 255 == (e >> 24 & 255) ? (o = e >> 8 & 255, n = 255 & e, 255 == (t = e >> 16 & 255) ? (t = 0, 255 === o ? (o = 0, 255 === n ? n = 0 : ++n) : ++o) : ++t, e = 0, e += t << 16, e += o << 8, e += n) : e += 1 << 24, e;
  }
  function j() {
    for (var e = this._X, t = this._C, o = 0; o < 8; o++) D[o] = t[o];
    for (t[0] = t[0] + 1295307597 + this._b | 0, t[1] = t[1] + 3545052371 + (t[0] >>> 0 < D[0] >>> 0 ? 1 : 0) | 0, t[2] = t[2] + 886263092 + (t[1] >>> 0 < D[1] >>> 0 ? 1 : 0) | 0, t[3] = t[3] + 1295307597 + (t[2] >>> 0 < D[2] >>> 0 ? 1 : 0) | 0, t[4] = t[4] + 3545052371 + (t[3] >>> 0 < D[3] >>> 0 ? 1 : 0) | 0, t[5] = t[5] + 886263092 + (t[4] >>> 0 < D[4] >>> 0 ? 1 : 0) | 0, t[6] = t[6] + 1295307597 + (t[5] >>> 0 < D[5] >>> 0 ? 1 : 0) | 0, t[7] = t[7] + 3545052371 + (t[6] >>> 0 < D[6] >>> 0 ? 1 : 0) | 0, this._b = t[7] >>> 0 < D[7] >>> 0 ? 1 : 0, o = 0; o < 8; o++) {
      var n = e[o] + t[o],
        i = 65535 & n,
        r = n >>> 16;
      E[o] = ((i * i >>> 17) + i * r >>> 15) + r * r ^ ((4294901760 & n) * n | 0) + ((65535 & n) * n | 0);
    }
    e[0] = E[0] + (E[7] << 16 | E[7] >>> 16) + (E[6] << 16 | E[6] >>> 16) | 0, e[1] = E[1] + (E[0] << 8 | E[0] >>> 24) + E[7] | 0, e[2] = E[2] + (E[1] << 16 | E[1] >>> 16) + (E[0] << 16 | E[0] >>> 16) | 0, e[3] = E[3] + (E[2] << 8 | E[2] >>> 24) + E[1] | 0, e[4] = E[4] + (E[3] << 16 | E[3] >>> 16) + (E[2] << 16 | E[2] >>> 16) | 0, e[5] = E[5] + (E[4] << 8 | E[4] >>> 24) + E[3] | 0, e[6] = E[6] + (E[5] << 16 | E[5] >>> 16) + (E[4] << 16 | E[4] >>> 16) | 0, e[7] = E[7] + (E[6] << 8 | E[6] >>> 24) + E[5] | 0;
  }
  function X() {
    for (var e = this._X, t = this._C, o = 0; o < 8; o++) U[o] = t[o];
    for (t[0] = t[0] + 1295307597 + this._b | 0, t[1] = t[1] + 3545052371 + (t[0] >>> 0 < U[0] >>> 0 ? 1 : 0) | 0, t[2] = t[2] + 886263092 + (t[1] >>> 0 < U[1] >>> 0 ? 1 : 0) | 0, t[3] = t[3] + 1295307597 + (t[2] >>> 0 < U[2] >>> 0 ? 1 : 0) | 0, t[4] = t[4] + 3545052371 + (t[3] >>> 0 < U[3] >>> 0 ? 1 : 0) | 0, t[5] = t[5] + 886263092 + (t[4] >>> 0 < U[4] >>> 0 ? 1 : 0) | 0, t[6] = t[6] + 1295307597 + (t[5] >>> 0 < U[5] >>> 0 ? 1 : 0) | 0, t[7] = t[7] + 3545052371 + (t[6] >>> 0 < U[6] >>> 0 ? 1 : 0) | 0, this._b = t[7] >>> 0 < U[7] >>> 0 ? 1 : 0, o = 0; o < 8; o++) {
      var n = e[o] + t[o],
        i = 65535 & n,
        r = n >>> 16;
      H[o] = ((i * i >>> 17) + i * r >>> 15) + r * r ^ ((4294901760 & n) * n | 0) + ((65535 & n) * n | 0);
    }
    e[0] = H[0] + (H[7] << 16 | H[7] >>> 16) + (H[6] << 16 | H[6] >>> 16) | 0, e[1] = H[1] + (H[0] << 8 | H[0] >>> 24) + H[7] | 0, e[2] = H[2] + (H[1] << 16 | H[1] >>> 16) + (H[0] << 16 | H[0] >>> 16) | 0, e[3] = H[3] + (H[2] << 8 | H[2] >>> 24) + H[1] | 0, e[4] = H[4] + (H[3] << 16 | H[3] >>> 16) + (H[2] << 16 | H[2] >>> 16) | 0, e[5] = H[5] + (H[4] << 8 | H[4] >>> 24) + H[3] | 0, e[6] = H[6] + (H[5] << 16 | H[5] >>> 16) + (H[4] << 16 | H[4] >>> 16) | 0, e[7] = H[7] + (H[6] << 8 | H[6] >>> 24) + H[5] | 0;
  }
  return N = (A = R).lib, e = N.Base, t = N.WordArray, (A = A.x64 = {}).Word = e.extend({
    init: function (e, t) {
      this.high = e, this.low = t;
    }
  }), A.WordArray = e.extend({
    init: function (e, t) {
      e = this.words = e || [], this.sigBytes = null != t ? t : 8 * e.length;
    },
    toX32: function () {
      for (var e = this.words, o = e.length, n = [], i = 0; i < o; i++) {
        var r = e[i];
        n.push(r.high), n.push(r.low);
      }
      return t.create(n, this.sigBytes);
    },
    clone: function () {
      for (var t = e.clone.call(this), o = t.words = this.words.slice(0), n = o.length, i = 0; i < n; i++) o[i] = o[i].clone();
      return t;
    }
  }), "function" == typeof ArrayBuffer && (O = R.lib.WordArray, o = O.init, (O.init = function (e) {
    if ((e = (e = e instanceof ArrayBuffer ? new Uint8Array(e) : e) instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e) instanceof Uint8Array) {
      for (var t = e.byteLength, n = [], i = 0; i < t; i++) n[i >>> 2] |= e[i] << 24 - i % 4 * 8;
      o.call(this, n, t);
    } else o.apply(this, arguments);
  }).prototype = O), function () {
    var e,
      t = (e = R).lib.WordArray;
    function o(e) {
      return e << 8 & 4278255360 | e >>> 8 & 16711935;
    }
    (e = e.enc).Utf16 = e.Utf16BE = {
      stringify: function (e) {
        for (var t = e.words, o = e.sigBytes, n = [], i = 0; i < o; i += 2) {
          var r = t[i >>> 2] >>> 16 - i % 4 * 8 & 65535;
          n.push(String.fromCharCode(r));
        }
        return n.join("");
      },
      parse: function (e) {
        for (var o = e.length, n = [], i = 0; i < o; i++) n[i >>> 1] |= e.charCodeAt(i) << 16 - i % 2 * 16;
        return t.create(n, 2 * o);
      }
    }, e.Utf16LE = {
      stringify: function (e) {
        for (var t = e.words, n = e.sigBytes, i = [], r = 0; r < n; r += 2) {
          var s = o(t[r >>> 2] >>> 16 - r % 4 * 8 & 65535);
          i.push(String.fromCharCode(s));
        }
        return i.join("");
      },
      parse: function (e) {
        for (var n = e.length, i = [], r = 0; r < n; r++) i[r >>> 1] |= o(e.charCodeAt(r) << 16 - r % 2 * 16);
        return t.create(i, 2 * n);
      }
    };
  }(), n = (b = R).lib.WordArray, b.enc.Base64 = {
    stringify: function (e) {
      var t = e.words,
        o = e.sigBytes,
        n = this._map;
      e.clamp();
      for (var i = [], r = 0; r < o; r += 3) for (var s = (t[r >>> 2] >>> 24 - r % 4 * 8 & 255) << 16 | (t[r + 1 >>> 2] >>> 24 - (r + 1) % 4 * 8 & 255) << 8 | t[r + 2 >>> 2] >>> 24 - (r + 2) % 4 * 8 & 255, a = 0; a < 4 && r + .75 * a < o; a++) i.push(n.charAt(s >>> 6 * (3 - a) & 63));
      var c = n.charAt(64);
      if (c) for (; i.length % 4;) i.push(c);
      return i.join("");
    },
    parse: function (e) {
      var t = e.length,
        o = this._map;
      if (!(i = this._reverseMap)) for (var i = this._reverseMap = [], r = 0; r < o.length; r++) i[o.charCodeAt(r)] = r;
      var s = o.charAt(64);
      return !s || -1 !== (s = e.indexOf(s)) && (t = s), function (e, t, o) {
        for (var i = [], r = 0, s = 0; s < t; s++) {
          var a, c;
          s % 4 && (a = o[e.charCodeAt(s - 1)] << s % 4 * 2, c = o[e.charCodeAt(s)] >>> 6 - s % 4 * 2, c |= a, i[r >>> 2] |= c << 24 - r % 4 * 8, r++);
        }
        return n.create(i, r);
      }(e, t, i);
    },
    _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  }, i = (N = R).lib.WordArray, N.enc.Base64url = {
    stringify: function (e, t = !0) {
      var o = e.words,
        n = e.sigBytes,
        i = t ? this._safe_map : this._map;
      e.clamp();
      for (var r = [], s = 0; s < n; s += 3) for (var a = (o[s >>> 2] >>> 24 - s % 4 * 8 & 255) << 16 | (o[s + 1 >>> 2] >>> 24 - (s + 1) % 4 * 8 & 255) << 8 | o[s + 2 >>> 2] >>> 24 - (s + 2) % 4 * 8 & 255, c = 0; c < 4 && s + .75 * c < n; c++) r.push(i.charAt(a >>> 6 * (3 - c) & 63));
      var l = i.charAt(64);
      if (l) for (; r.length % 4;) r.push(l);
      return r.join("");
    },
    parse: function (e, t = !0) {
      var o = e.length,
        n = t ? this._safe_map : this._map;
      if (!(r = this._reverseMap)) for (var r = this._reverseMap = [], s = 0; s < n.length; s++) r[n.charCodeAt(s)] = s;
      return !(t = n.charAt(64)) || -1 !== (t = e.indexOf(t)) && (o = t), function (e, t, o) {
        for (var n = [], r = 0, s = 0; s < t; s++) {
          var a, c;
          s % 4 && (a = o[e.charCodeAt(s - 1)] << s % 4 * 2, c = o[e.charCodeAt(s)] >>> 6 - s % 4 * 2, c |= a, n[r >>> 2] |= c << 24 - r % 4 * 8, r++);
        }
        return i.create(n, r);
      }(e, o, r);
    },
    _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
    _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
  }, function (e) {
    var t = R,
      o = (i = t.lib).WordArray,
      n = i.Hasher,
      i = t.algo,
      r = [];
    function s(e, t, o, n, i, r, s) {
      return ((s = e + (t & o | ~t & n) + i + s) << r | s >>> 32 - r) + t;
    }
    function a(e, t, o, n, i, r, s) {
      return ((s = e + (t & n | o & ~n) + i + s) << r | s >>> 32 - r) + t;
    }
    function c(e, t, o, n, i, r, s) {
      return ((s = e + (t ^ o ^ n) + i + s) << r | s >>> 32 - r) + t;
    }
    function l(e, t, o, n, i, r, s) {
      return ((s = e + (o ^ (t | ~n)) + i + s) << r | s >>> 32 - r) + t;
    }
    !function () {
      for (var t = 0; t < 64; t++) r[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
    }(), i = i.MD5 = n.extend({
      _doReset: function () {
        this._hash = new o.init([1732584193, 4023233417, 2562383102, 271733878]);
      },
      _doProcessBlock: function (e, t) {
        for (var o = 0; o < 16; o++) {
          var n = t + o,
            i = e[n];
          e[n] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8);
        }
        var d = this._hash.words,
          u = e[t + 0],
          p = e[t + 1],
          g = e[t + 2],
          h = e[t + 3],
          f = e[t + 4],
          m = e[t + 5],
          y = e[t + 6],
          _ = e[t + 7],
          v = e[t + 8],
          w = e[t + 9],
          S = e[t + 10],
          C = e[t + 11],
          x = e[t + 12],
          P = e[t + 13],
          B = e[t + 14],
          b = e[t + 15],
          k = s(k = d[0], T = d[1], I = d[2], z = d[3], u, 7, r[0]),
          z = s(z, k, T, I, p, 12, r[1]),
          I = s(I, z, k, T, g, 17, r[2]),
          T = s(T, I, z, k, h, 22, r[3]);
        k = s(k, T, I, z, f, 7, r[4]), z = s(z, k, T, I, m, 12, r[5]), I = s(I, z, k, T, y, 17, r[6]), T = s(T, I, z, k, _, 22, r[7]), k = s(k, T, I, z, v, 7, r[8]), z = s(z, k, T, I, w, 12, r[9]), I = s(I, z, k, T, S, 17, r[10]), T = s(T, I, z, k, C, 22, r[11]), k = s(k, T, I, z, x, 7, r[12]), z = s(z, k, T, I, P, 12, r[13]), I = s(I, z, k, T, B, 17, r[14]), k = a(k, T = s(T, I, z, k, b, 22, r[15]), I, z, p, 5, r[16]), z = a(z, k, T, I, y, 9, r[17]), I = a(I, z, k, T, C, 14, r[18]), T = a(T, I, z, k, u, 20, r[19]), k = a(k, T, I, z, m, 5, r[20]), z = a(z, k, T, I, S, 9, r[21]), I = a(I, z, k, T, b, 14, r[22]), T = a(T, I, z, k, f, 20, r[23]), k = a(k, T, I, z, w, 5, r[24]), z = a(z, k, T, I, B, 9, r[25]), I = a(I, z, k, T, h, 14, r[26]), T = a(T, I, z, k, v, 20, r[27]), k = a(k, T, I, z, P, 5, r[28]), z = a(z, k, T, I, g, 9, r[29]), I = a(I, z, k, T, _, 14, r[30]), k = c(k, T = a(T, I, z, k, x, 20, r[31]), I, z, m, 4, r[32]), z = c(z, k, T, I, v, 11, r[33]), I = c(I, z, k, T, C, 16, r[34]), T = c(T, I, z, k, B, 23, r[35]), k = c(k, T, I, z, p, 4, r[36]), z = c(z, k, T, I, f, 11, r[37]), I = c(I, z, k, T, _, 16, r[38]), T = c(T, I, z, k, S, 23, r[39]), k = c(k, T, I, z, P, 4, r[40]), z = c(z, k, T, I, u, 11, r[41]), I = c(I, z, k, T, h, 16, r[42]), T = c(T, I, z, k, y, 23, r[43]), k = c(k, T, I, z, w, 4, r[44]), z = c(z, k, T, I, x, 11, r[45]), I = c(I, z, k, T, b, 16, r[46]), k = l(k, T = c(T, I, z, k, g, 23, r[47]), I, z, u, 6, r[48]), z = l(z, k, T, I, _, 10, r[49]), I = l(I, z, k, T, B, 15, r[50]), T = l(T, I, z, k, m, 21, r[51]), k = l(k, T, I, z, x, 6, r[52]), z = l(z, k, T, I, h, 10, r[53]), I = l(I, z, k, T, S, 15, r[54]), T = l(T, I, z, k, p, 21, r[55]), k = l(k, T, I, z, v, 6, r[56]), z = l(z, k, T, I, b, 10, r[57]), I = l(I, z, k, T, y, 15, r[58]), T = l(T, I, z, k, P, 21, r[59]), k = l(k, T, I, z, f, 6, r[60]), z = l(z, k, T, I, C, 10, r[61]), I = l(I, z, k, T, g, 15, r[62]), T = l(T, I, z, k, w, 21, r[63]), d[0] = d[0] + k | 0, d[1] = d[1] + T | 0, d[2] = d[2] + I | 0, d[3] = d[3] + z | 0;
      },
      _doFinalize: function () {
        var t = this._data,
          o = t.words,
          n = 8 * this._nDataBytes,
          i = 8 * t.sigBytes;
        o[i >>> 5] |= 128 << 24 - i % 32;
        var r = e.floor(n / 4294967296);
        n = n, o[15 + (64 + i >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), o[14 + (64 + i >>> 9 << 4)] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), t.sigBytes = 4 * (o.length + 1), this._process();
        for (var s = (o = this._hash).words, a = 0; a < 4; a++) {
          var c = s[a];
          s[a] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8);
        }
        return o;
      },
      clone: function () {
        var e = n.clone.call(this);
        return e._hash = this._hash.clone(), e;
      }
    }), t.MD5 = n._createHelper(i), t.HmacMD5 = n._createHmacHelper(i);
  }(Math), O = (A = R).lib, r = O.WordArray, s = O.Hasher, O = A.algo, a = [], O = O.SHA1 = s.extend({
    _doReset: function () {
      this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
    },
    _doProcessBlock: function (e, t) {
      for (var o = this._hash.words, n = o[0], i = o[1], r = o[2], s = o[3], c = o[4], l = 0; l < 80; l++) {
        l < 16 ? a[l] = 0 | e[t + l] : (d = a[l - 3] ^ a[l - 8] ^ a[l - 14] ^ a[l - 16], a[l] = d << 1 | d >>> 31);
        var d = (n << 5 | n >>> 27) + c + a[l];
        d += l < 20 ? 1518500249 + (i & r | ~i & s) : l < 40 ? 1859775393 + (i ^ r ^ s) : l < 60 ? (i & r | i & s | r & s) - 1894007588 : (i ^ r ^ s) - 899497514, c = s, s = r, r = i << 30 | i >>> 2, i = n, n = d;
      }
      o[0] = o[0] + n | 0, o[1] = o[1] + i | 0, o[2] = o[2] + r | 0, o[3] = o[3] + s | 0, o[4] = o[4] + c | 0;
    },
    _doFinalize: function () {
      var e = this._data,
        t = e.words,
        o = 8 * this._nDataBytes,
        n = 8 * e.sigBytes;
      return t[n >>> 5] |= 128 << 24 - n % 32, t[14 + (64 + n >>> 9 << 4)] = Math.floor(o / 4294967296), t[15 + (64 + n >>> 9 << 4)] = o, e.sigBytes = 4 * t.length, this._process(), this._hash;
    },
    clone: function () {
      var e = s.clone.call(this);
      return e._hash = this._hash.clone(), e;
    }
  }), A.SHA1 = s._createHelper(O), A.HmacSHA1 = s._createHmacHelper(O), function (e) {
    var t = R,
      o = (i = t.lib).WordArray,
      n = i.Hasher,
      i = t.algo,
      r = [],
      s = [];
    !function () {
      function t(e) {
        return 4294967296 * (e - (0 | e)) | 0;
      }
      for (var o = 2, n = 0; n < 64;) !function (t) {
        for (var o = e.sqrt(t), n = 2; n <= o; n++) if (!(t % n)) return;
        return 1;
      }(o) || (n < 8 && (r[n] = t(e.pow(o, .5))), s[n] = t(e.pow(o, 1 / 3)), n++), o++;
    }();
    var a = [];
    i = i.SHA256 = n.extend({
      _doReset: function () {
        this._hash = new o.init(r.slice(0));
      },
      _doProcessBlock: function (e, t) {
        for (var o = this._hash.words, n = o[0], i = o[1], r = o[2], c = o[3], l = o[4], d = o[5], u = o[6], p = o[7], g = 0; g < 64; g++) {
          g < 16 ? a[g] = 0 | e[t + g] : (h = a[g - 15], f = a[g - 2], a[g] = ((h << 25 | h >>> 7) ^ (h << 14 | h >>> 18) ^ h >>> 3) + a[g - 7] + ((f << 15 | f >>> 17) ^ (f << 13 | f >>> 19) ^ f >>> 10) + a[g - 16]);
          var h = n & i ^ n & r ^ i & r,
            f = p + ((l << 26 | l >>> 6) ^ (l << 21 | l >>> 11) ^ (l << 7 | l >>> 25)) + (l & d ^ ~l & u) + s[g] + a[g];
          p = u, u = d, d = l, l = c + f | 0, c = r, r = i, i = n, n = f + (((n << 30 | n >>> 2) ^ (n << 19 | n >>> 13) ^ (n << 10 | n >>> 22)) + h) | 0;
        }
        o[0] = o[0] + n | 0, o[1] = o[1] + i | 0, o[2] = o[2] + r | 0, o[3] = o[3] + c | 0, o[4] = o[4] + l | 0, o[5] = o[5] + d | 0, o[6] = o[6] + u | 0, o[7] = o[7] + p | 0;
      },
      _doFinalize: function () {
        var t = this._data,
          o = t.words,
          n = 8 * this._nDataBytes,
          i = 8 * t.sigBytes;
        return o[i >>> 5] |= 128 << 24 - i % 32, o[14 + (64 + i >>> 9 << 4)] = e.floor(n / 4294967296), o[15 + (64 + i >>> 9 << 4)] = n, t.sigBytes = 4 * o.length, this._process(), this._hash;
      },
      clone: function () {
        var e = n.clone.call(this);
        return e._hash = this._hash.clone(), e;
      }
    }), t.SHA256 = n._createHelper(i), t.HmacSHA256 = n._createHmacHelper(i);
  }(Math), c = (b = R).lib.WordArray, N = b.algo, l = N.SHA256, N = N.SHA224 = l.extend({
    _doReset: function () {
      this._hash = new c.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
    },
    _doFinalize: function () {
      var e = l._doFinalize.call(this);
      return e.sigBytes -= 4, e;
    }
  }), b.SHA224 = l._createHelper(N), b.HmacSHA224 = l._createHmacHelper(N), function () {
    var e = R,
      t = e.lib.Hasher,
      o = (i = e.x64).Word,
      n = i.WordArray,
      i = e.algo;
    function r() {
      return o.create.apply(o, arguments);
    }
    var s = [r(1116352408, 3609767458), r(1899447441, 602891725), r(3049323471, 3964484399), r(3921009573, 2173295548), r(961987163, 4081628472), r(1508970993, 3053834265), r(2453635748, 2937671579), r(2870763221, 3664609560), r(3624381080, 2734883394), r(310598401, 1164996542), r(607225278, 1323610764), r(1426881987, 3590304994), r(1925078388, 4068182383), r(2162078206, 991336113), r(2614888103, 633803317), r(3248222580, 3479774868), r(3835390401, 2666613458), r(4022224774, 944711139), r(264347078, 2341262773), r(604807628, 2007800933), r(770255983, 1495990901), r(1249150122, 1856431235), r(1555081692, 3175218132), r(1996064986, 2198950837), r(2554220882, 3999719339), r(2821834349, 766784016), r(2952996808, 2566594879), r(3210313671, 3203337956), r(3336571891, 1034457026), r(3584528711, 2466948901), r(113926993, 3758326383), r(338241895, 168717936), r(666307205, 1188179964), r(773529912, 1546045734), r(1294757372, 1522805485), r(1396182291, 2643833823), r(1695183700, 2343527390), r(1986661051, 1014477480), r(2177026350, 1206759142), r(2456956037, 344077627), r(2730485921, 1290863460), r(2820302411, 3158454273), r(3259730800, 3505952657), r(3345764771, 106217008), r(3516065817, 3606008344), r(3600352804, 1432725776), r(4094571909, 1467031594), r(275423344, 851169720), r(430227734, 3100823752), r(506948616, 1363258195), r(659060556, 3750685593), r(883997877, 3785050280), r(958139571, 3318307427), r(1322822218, 3812723403), r(1537002063, 2003034995), r(1747873779, 3602036899), r(1955562222, 1575990012), r(2024104815, 1125592928), r(2227730452, 2716904306), r(2361852424, 442776044), r(2428436474, 593698344), r(2756734187, 3733110249), r(3204031479, 2999351573), r(3329325298, 3815920427), r(3391569614, 3928383900), r(3515267271, 566280711), r(3940187606, 3454069534), r(4118630271, 4000239992), r(116418474, 1914138554), r(174292421, 2731055270), r(289380356, 3203993006), r(460393269, 320620315), r(685471733, 587496836), r(852142971, 1086792851), r(1017036298, 365543100), r(1126000580, 2618297676), r(1288033470, 3409855158), r(1501505948, 4234509866), r(1607167915, 987167468), r(1816402316, 1246189591)],
      a = [];
    !function () {
      for (var e = 0; e < 80; e++) a[e] = r();
    }(), i = i.SHA512 = t.extend({
      _doReset: function () {
        this._hash = new n.init([new o.init(1779033703, 4089235720), new o.init(3144134277, 2227873595), new o.init(1013904242, 4271175723), new o.init(2773480762, 1595750129), new o.init(1359893119, 2917565137), new o.init(2600822924, 725511199), new o.init(528734635, 4215389547), new o.init(1541459225, 327033209)]);
      },
      _doProcessBlock: function (e, t) {
        for (var o, n = (o = this._hash.words)[0], i = o[1], r = o[2], c = o[3], l = o[4], d = o[5], u = o[6], p = o[7], g = n.high, h = n.low, f = i.high, m = i.low, y = r.high, _ = r.low, v = c.high, w = c.low, S = l.high, C = l.low, x = d.high, P = d.low, B = u.high, b = u.low, k = p.high, z = g, I = h, T = f, D = m, E = y, A = _, N = v, O = w, M = S, U = C, H = x, R = P, G = B, F = b, J = k, W = o = p.low, L = 0; L < 80; L++) {
          var j,
            X,
            K = a[L];
          L < 16 ? (X = K.high = 0 | e[t + 2 * L], j = K.low = 0 | e[t + 2 * L + 1]) : (ee = (q = a[L - 15]).high, te = q.low, $ = (Q = a[L - 2]).high, Y = Q.low, V = (Z = a[L - 7]).high, q = Z.low, Z = (Q = a[L - 16]).high, X = (X = ((ee >>> 1 | te << 31) ^ (ee >>> 8 | te << 24) ^ ee >>> 7) + V + ((j = (V = (te >>> 1 | ee << 31) ^ (te >>> 8 | ee << 24) ^ (te >>> 7 | ee << 25)) + q) >>> 0 < V >>> 0 ? 1 : 0)) + (($ >>> 19 | Y << 13) ^ ($ << 3 | Y >>> 29) ^ $ >>> 6) + ((j += te = (Y >>> 19 | $ << 13) ^ (Y << 3 | $ >>> 29) ^ (Y >>> 6 | $ << 26)) >>> 0 < te >>> 0 ? 1 : 0), j += ee = Q.low, K.high = X = X + Z + (j >>> 0 < ee >>> 0 ? 1 : 0), K.low = j);
          var q = M & H ^ ~M & G,
            V = U & R ^ ~U & F,
            Y = z & T ^ z & E ^ T & E,
            $ = (I >>> 28 | z << 4) ^ (I << 30 | z >>> 2) ^ (I << 25 | z >>> 7),
            Q = (te = s[L]).high,
            Z = te.low,
            ee = W + ((U >>> 14 | M << 18) ^ (U >>> 18 | M << 14) ^ (U << 23 | M >>> 9)),
            te = (K = J + ((M >>> 14 | U << 18) ^ (M >>> 18 | U << 14) ^ (M << 23 | U >>> 9)) + (ee >>> 0 < W >>> 0 ? 1 : 0), $ + (I & D ^ I & A ^ D & A));
          J = G, W = F, G = H, F = R, H = M, R = U, M = N + (K = (K = (K = K + q + ((ee += V) >>> 0 < V >>> 0 ? 1 : 0)) + Q + ((ee += Z) >>> 0 < Z >>> 0 ? 1 : 0)) + X + ((ee += j) >>> 0 < j >>> 0 ? 1 : 0)) + ((U = O + ee | 0) >>> 0 < O >>> 0 ? 1 : 0) | 0, N = E, O = A, E = T, A = D, T = z, D = I, z = K + (((z >>> 28 | I << 4) ^ (z << 30 | I >>> 2) ^ (z << 25 | I >>> 7)) + Y + (te >>> 0 < $ >>> 0 ? 1 : 0)) + ((I = ee + te | 0) >>> 0 < ee >>> 0 ? 1 : 0) | 0;
        }
        h = n.low = h + I, n.high = g + z + (h >>> 0 < I >>> 0 ? 1 : 0), m = i.low = m + D, i.high = f + T + (m >>> 0 < D >>> 0 ? 1 : 0), _ = r.low = _ + A, r.high = y + E + (_ >>> 0 < A >>> 0 ? 1 : 0), w = c.low = w + O, c.high = v + N + (w >>> 0 < O >>> 0 ? 1 : 0), C = l.low = C + U, l.high = S + M + (C >>> 0 < U >>> 0 ? 1 : 0), P = d.low = P + R, d.high = x + H + (P >>> 0 < R >>> 0 ? 1 : 0), b = u.low = b + F, u.high = B + G + (b >>> 0 < F >>> 0 ? 1 : 0), o = p.low = o + W, p.high = k + J + (o >>> 0 < W >>> 0 ? 1 : 0);
      },
      _doFinalize: function () {
        var e = this._data,
          t = e.words,
          o = 8 * this._nDataBytes,
          n = 8 * e.sigBytes;
        return t[n >>> 5] |= 128 << 24 - n % 32, t[30 + (128 + n >>> 10 << 5)] = Math.floor(o / 4294967296), t[31 + (128 + n >>> 10 << 5)] = o, e.sigBytes = 4 * t.length, this._process(), this._hash.toX32();
      },
      clone: function () {
        var e = t.clone.call(this);
        return e._hash = this._hash.clone(), e;
      },
      blockSize: 32
    }), e.SHA512 = t._createHelper(i), e.HmacSHA512 = t._createHmacHelper(i);
  }(), O = (A = R).x64, d = O.Word, u = O.WordArray, O = A.algo, p = O.SHA512, O = O.SHA384 = p.extend({
    _doReset: function () {
      this._hash = new u.init([new d.init(3418070365, 3238371032), new d.init(1654270250, 914150663), new d.init(2438529370, 812702999), new d.init(355462360, 4144912697), new d.init(1731405415, 4290775857), new d.init(2394180231, 1750603025), new d.init(3675008525, 1694076839), new d.init(1203062813, 3204075428)]);
    },
    _doFinalize: function () {
      var e = p._doFinalize.call(this);
      return e.sigBytes -= 16, e;
    }
  }), A.SHA384 = p._createHelper(O), A.HmacSHA384 = p._createHmacHelper(O), function (e) {
    var t = R,
      o = (r = t.lib).WordArray,
      n = r.Hasher,
      i = t.x64.Word,
      r = t.algo,
      s = [],
      a = [],
      c = [];
    !function () {
      for (var e = 1, t = 0, o = 0; o < 24; o++) {
        s[e + 5 * t] = (o + 1) * (o + 2) / 2 % 64;
        var n = (2 * e + 3 * t) % 5;
        e = t % 5, t = n;
      }
      for (e = 0; e < 5; e++) for (t = 0; t < 5; t++) a[e + 5 * t] = t + (2 * e + 3 * t) % 5 * 5;
      for (var r = 1, l = 0; l < 24; l++) {
        for (var d, u = 0, p = 0, g = 0; g < 7; g++) 1 & r && ((d = (1 << g) - 1) < 32 ? p ^= 1 << d : u ^= 1 << d - 32), 128 & r ? r = r << 1 ^ 113 : r <<= 1;
        c[l] = i.create(u, p);
      }
    }();
    var l = [];
    !function () {
      for (var e = 0; e < 25; e++) l[e] = i.create();
    }(), r = r.SHA3 = n.extend({
      cfg: n.cfg.extend({
        outputLength: 512
      }),
      _doReset: function () {
        for (var e = this._state = [], t = 0; t < 25; t++) e[t] = new i.init();
        this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
      },
      _doProcessBlock: function (e, t) {
        for (var o = this._state, n = this.blockSize / 2, i = 0; i < n; i++) {
          var r = e[t + 2 * i],
            d = e[t + 2 * i + 1];
          r = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), (b = o[i]).high ^= d = 16711935 & (d << 8 | d >>> 24) | 4278255360 & (d << 24 | d >>> 8), b.low ^= r;
        }
        for (var u = 0; u < 24; u++) {
          for (var p = 0; p < 5; p++) {
            for (var g = 0, h = 0, f = 0; f < 5; f++) g ^= (b = o[p + 5 * f]).high, h ^= b.low;
            var m = l[p];
            m.high = g, m.low = h;
          }
          for (p = 0; p < 5; p++) {
            var y = l[(p + 4) % 5],
              _ = (v = l[(p + 1) % 5]).high,
              v = v.low;
            for (g = y.high ^ (_ << 1 | v >>> 31), h = y.low ^ (v << 1 | _ >>> 31), f = 0; f < 5; f++) (b = o[p + 5 * f]).high ^= g, b.low ^= h;
          }
          for (var w = 1; w < 25; w++) {
            var S = (b = o[w]).high,
              C = b.low,
              x = s[w];
            h = x < 32 ? (g = S << x | C >>> 32 - x, C << x | S >>> 32 - x) : (g = C << x - 32 | S >>> 64 - x, S << x - 32 | C >>> 64 - x), (x = l[a[w]]).high = g, x.low = h;
          }
          var P = l[0],
            B = o[0];
          for (P.high = B.high, P.low = B.low, p = 0; p < 5; p++) for (f = 0; f < 5; f++) {
            var b = o[w = p + 5 * f],
              k = l[w],
              z = l[(p + 1) % 5 + 5 * f],
              I = l[(p + 2) % 5 + 5 * f];
            b.high = k.high ^ ~z.high & I.high, b.low = k.low ^ ~z.low & I.low;
          }
          b = o[0], B = c[u], b.high ^= B.high, b.low ^= B.low;
        }
      },
      _doFinalize: function () {
        var t = this._data,
          n = t.words,
          i = (this._nDataBytes, 8 * t.sigBytes),
          r = 32 * this.blockSize;
        n[i >>> 5] |= 1 << 24 - i % 32, n[(e.ceil((1 + i) / r) * r >>> 5) - 1] |= 128, t.sigBytes = 4 * n.length, this._process();
        for (var s = this._state, a = (n = this.cfg.outputLength / 8) / 8, c = [], l = 0; l < a; l++) {
          var d = (u = s[l]).high,
            u = u.low;
          d = 16711935 & (d << 8 | d >>> 24) | 4278255360 & (d << 24 | d >>> 8), c.push(u = 16711935 & (u << 8 | u >>> 24) | 4278255360 & (u << 24 | u >>> 8)), c.push(d);
        }
        return new o.init(c, n);
      },
      clone: function () {
        for (var e = n.clone.call(this), t = e._state = this._state.slice(0), o = 0; o < 25; o++) t[o] = t[o].clone();
        return e;
      }
    }), t.SHA3 = n._createHelper(r), t.HmacSHA3 = n._createHmacHelper(r);
  }(Math), Math, N = (b = R).lib, g = N.WordArray, h = N.Hasher, N = b.algo, f = g.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), m = g.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), y = g.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), _ = g.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), v = g.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), w = g.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), N = N.RIPEMD160 = h.extend({
    _doReset: function () {
      this._hash = g.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
    },
    _doProcessBlock: function (e, t) {
      for (var o = 0; o < 16; o++) {
        var n = t + o,
          i = e[n];
        e[n] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8);
      }
      var r,
        s,
        a,
        c,
        l,
        d,
        u = this._hash.words,
        p = v.words,
        g = w.words,
        h = f.words,
        S = m.words,
        C = y.words,
        x = _.words,
        P = r = u[0],
        B = s = u[1],
        b = a = u[2],
        k = c = u[3],
        z = l = u[4];
      for (o = 0; o < 80; o += 1) d = r + e[t + h[o]] | 0, d += o < 16 ? (s ^ a ^ c) + p[0] : o < 32 ? G(s, a, c) + p[1] : o < 48 ? ((s | ~a) ^ c) + p[2] : o < 64 ? F(s, a, c) + p[3] : (s ^ (a | ~c)) + p[4], d = (d = J(d |= 0, C[o])) + l | 0, r = l, l = c, c = J(a, 10), a = s, s = d, d = P + e[t + S[o]] | 0, d += o < 16 ? (B ^ (b | ~k)) + g[0] : o < 32 ? F(B, b, k) + g[1] : o < 48 ? ((B | ~b) ^ k) + g[2] : o < 64 ? G(B, b, k) + g[3] : (B ^ b ^ k) + g[4], d = (d = J(d |= 0, x[o])) + z | 0, P = z, z = k, k = J(b, 10), b = B, B = d;
      d = u[1] + a + k | 0, u[1] = u[2] + c + z | 0, u[2] = u[3] + l + P | 0, u[3] = u[4] + r + B | 0, u[4] = u[0] + s + b | 0, u[0] = d;
    },
    _doFinalize: function () {
      var e = this._data,
        t = e.words,
        o = 8 * this._nDataBytes,
        n = 8 * e.sigBytes;
      t[n >>> 5] |= 128 << 24 - n % 32, t[14 + (64 + n >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), e.sigBytes = 4 * (t.length + 1), this._process();
      for (var i = (t = this._hash).words, r = 0; r < 5; r++) {
        var s = i[r];
        i[r] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8);
      }
      return t;
    },
    clone: function () {
      var e = h.clone.call(this);
      return e._hash = this._hash.clone(), e;
    }
  }), b.RIPEMD160 = h._createHelper(N), b.HmacRIPEMD160 = h._createHmacHelper(N), O = (A = R).lib.Base, S = A.enc.Utf8, A.algo.HMAC = O.extend({
    init: function (e, t) {
      e = this._hasher = new e.init(), "string" == typeof t && (t = S.parse(t));
      var o = e.blockSize,
        n = 4 * o;
      (t = t.sigBytes > n ? e.finalize(t) : t).clamp(), e = this._oKey = t.clone(), t = this._iKey = t.clone();
      for (var i = e.words, r = t.words, s = 0; s < o; s++) i[s] ^= 1549556828, r[s] ^= 909522486;
      e.sigBytes = t.sigBytes = n, this.reset();
    },
    reset: function () {
      var e = this._hasher;
      e.reset(), e.update(this._iKey);
    },
    update: function (e) {
      return this._hasher.update(e), this;
    },
    finalize: function (e) {
      var t = this._hasher;
      return e = t.finalize(e), t.reset(), t.finalize(this._oKey.clone().concat(e));
    }
  }), A = (N = (b = R).lib).Base, C = N.WordArray, N = (O = b.algo).SHA1, x = O.HMAC, P = O.PBKDF2 = A.extend({
    cfg: A.extend({
      keySize: 4,
      hasher: N,
      iterations: 1
    }),
    init: function (e) {
      this.cfg = this.cfg.extend(e);
    },
    compute: function (e, t) {
      for (var o = this.cfg, n = x.create(o.hasher, e), i = C.create(), r = C.create([1]), s = i.words, a = r.words, c = o.keySize, l = o.iterations; s.length < c;) {
        var d = n.update(t).finalize(r);
        n.reset();
        for (var u = d.words, p = u.length, g = d, h = 1; h < l; h++) {
          g = n.finalize(g), n.reset();
          for (var f = g.words, m = 0; m < p; m++) u[m] ^= f[m];
        }
        i.concat(d), a[0]++;
      }
      return i.sigBytes = 4 * c, i;
    }
  }), b.PBKDF2 = function (e, t, o) {
    return P.create(o).compute(e, t);
  }, N = (A = (O = R).lib).Base, B = A.WordArray, A = (b = O.algo).MD5, k = b.EvpKDF = N.extend({
    cfg: N.extend({
      keySize: 4,
      hasher: A,
      iterations: 1
    }),
    init: function (e) {
      this.cfg = this.cfg.extend(e);
    },
    compute: function (e, t) {
      for (var o, n = this.cfg, i = n.hasher.create(), r = B.create(), s = r.words, a = n.keySize, c = n.iterations; s.length < a;) {
        o && i.update(o), o = i.update(e).finalize(t), i.reset();
        for (var l = 1; l < c; l++) o = i.finalize(o), i.reset();
        r.concat(o);
      }
      return r.sigBytes = 4 * a, r;
    }
  }), O.EvpKDF = function (e, t, o) {
    return k.create(o).compute(e, t);
  }, R.lib.Cipher || function () {
    var e = (g = R).lib,
      t = e.Base,
      o = e.WordArray,
      n = e.BufferedBlockAlgorithm,
      i = ((l = g.enc).Utf8, l.Base64),
      r = g.algo.EvpKDF,
      s = e.Cipher = n.extend({
        cfg: t.extend(),
        createEncryptor: function (e, t) {
          return this.create(this._ENC_XFORM_MODE, e, t);
        },
        createDecryptor: function (e, t) {
          return this.create(this._DEC_XFORM_MODE, e, t);
        },
        init: function (e, t, o) {
          this.cfg = this.cfg.extend(o), this._xformMode = e, this._key = t, this.reset();
        },
        reset: function () {
          n.reset.call(this), this._doReset();
        },
        process: function (e) {
          return this._append(e), this._process();
        },
        finalize: function (e) {
          return e && this._append(e), this._doFinalize();
        },
        keySize: 4,
        ivSize: 4,
        _ENC_XFORM_MODE: 1,
        _DEC_XFORM_MODE: 2,
        _createHelper: function (e) {
          return {
            encrypt: function (t, o, n) {
              return a(o).encrypt(e, t, o, n);
            },
            decrypt: function (t, o, n) {
              return a(o).decrypt(e, t, o, n);
            }
          };
        }
      });
    function a(e) {
      return "string" == typeof e ? h : p;
    }
    e.StreamCipher = s.extend({
      _doFinalize: function () {
        return this._process(!0);
      },
      blockSize: 1
    });
    var c = g.mode = {},
      l = e.BlockCipherMode = t.extend({
        createEncryptor: function (e, t) {
          return this.Encryptor.create(e, t);
        },
        createDecryptor: function (e, t) {
          return this.Decryptor.create(e, t);
        },
        init: function (e, t) {
          this._cipher = e, this._iv = t;
        }
      });
    function d(e, t, o) {
      var n,
        i = this._iv;
      i ? (n = i, this._iv = void 0) : n = this._prevBlock;
      for (var r = 0; r < o; r++) e[t + r] ^= n[r];
    }
    l = c.CBC = ((c = l.extend()).Encryptor = c.extend({
      processBlock: function (e, t) {
        var o = this._cipher,
          n = o.blockSize;
        d.call(this, e, t, n), o.encryptBlock(e, t), this._prevBlock = e.slice(t, t + n);
      }
    }), c.Decryptor = c.extend({
      processBlock: function (e, t) {
        var o = this._cipher,
          n = o.blockSize,
          i = e.slice(t, t + n);
        o.decryptBlock(e, t), d.call(this, e, t, n), this._prevBlock = i;
      }
    }), c), c = (g.pad = {}).Pkcs7 = {
      pad: function (e, t) {
        for (var n = (t *= 4) - e.sigBytes % t, i = n << 24 | n << 16 | n << 8 | n, r = [], s = 0; s < n; s += 4) r.push(i);
        t = o.create(r, n), e.concat(t);
      },
      unpad: function (e) {
        var t = 255 & e.words[e.sigBytes - 1 >>> 2];
        e.sigBytes -= t;
      }
    };
    var u = (e.BlockCipher = s.extend({
        cfg: s.cfg.extend({
          mode: l,
          padding: c
        }),
        reset: function () {
          var e;
          s.reset.call(this);
          var t = (o = this.cfg).iv,
            o = o.mode;
          this._xformMode == this._ENC_XFORM_MODE ? e = o.createEncryptor : (e = o.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, t && t.words) : (this._mode = e.call(o, this, t && t.words), this._mode.__creator = e);
        },
        _doProcessBlock: function (e, t) {
          this._mode.processBlock(e, t);
        },
        _doFinalize: function () {
          var e,
            t = this.cfg.padding;
          return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e;
        },
        blockSize: 4
      }), e.CipherParams = t.extend({
        init: function (e) {
          this.mixIn(e);
        },
        toString: function (e) {
          return (e || this.formatter).stringify(this);
        }
      })),
      p = (c = (g.format = {}).OpenSSL = {
        stringify: function (e) {
          var t = e.ciphertext;
          return (t = (e = e.salt) ? o.create([1398893684, 1701076831]).concat(e).concat(t) : t).toString(i);
        },
        parse: function (e) {
          var t,
            n = i.parse(e);
          return 1398893684 == (e = n.words)[0] && 1701076831 == e[1] && (t = o.create(e.slice(2, 4)), e.splice(0, 4), n.sigBytes -= 16), u.create({
            ciphertext: n,
            salt: t
          });
        }
      }, e.SerializableCipher = t.extend({
        cfg: t.extend({
          format: c
        }),
        encrypt: function (e, t, o, n) {
          n = this.cfg.extend(n), t = (i = e.createEncryptor(o, n)).finalize(t);
          var i = i.cfg;
          return u.create({
            ciphertext: t,
            key: o,
            iv: i.iv,
            algorithm: e,
            mode: i.mode,
            padding: i.padding,
            blockSize: e.blockSize,
            formatter: n.format
          });
        },
        decrypt: function (e, t, o, n) {
          return n = this.cfg.extend(n), t = this._parse(t, n.format), e.createDecryptor(o, n).finalize(t.ciphertext);
        },
        _parse: function (e, t) {
          return "string" == typeof e ? t.parse(e, this) : e;
        }
      })),
      g = (g.kdf = {}).OpenSSL = {
        execute: function (e, t, n, i) {
          return i = i || o.random(8), e = r.create({
            keySize: t + n
          }).compute(e, i), n = o.create(e.words.slice(t), 4 * n), e.sigBytes = 4 * t, u.create({
            key: e,
            iv: n,
            salt: i
          });
        }
      },
      h = e.PasswordBasedCipher = p.extend({
        cfg: p.cfg.extend({
          kdf: g
        }),
        encrypt: function (e, t, o, n) {
          return o = (n = this.cfg.extend(n)).kdf.execute(o, e.keySize, e.ivSize), n.iv = o.iv, (n = p.encrypt.call(this, e, t, o.key, n)).mixIn(o), n;
        },
        decrypt: function (e, t, o, n) {
          return n = this.cfg.extend(n), t = this._parse(t, n.format), o = n.kdf.execute(o, e.keySize, e.ivSize, t.salt), n.iv = o.iv, p.decrypt.call(this, e, t, o.key, n);
        }
      });
  }(), R.mode.CFB = ((N = R.lib.BlockCipherMode.extend()).Encryptor = N.extend({
    processBlock: function (e, t) {
      var o = this._cipher,
        n = o.blockSize;
      W.call(this, e, t, n, o), this._prevBlock = e.slice(t, t + n);
    }
  }), N.Decryptor = N.extend({
    processBlock: function (e, t) {
      var o = this._cipher,
        n = o.blockSize,
        i = e.slice(t, t + n);
      W.call(this, e, t, n, o), this._prevBlock = i;
    }
  }), N), R.mode.CTR = (O = (A = R.lib.BlockCipherMode.extend()).Encryptor = A.extend({
    processBlock: function (e, t) {
      var o = this._cipher,
        n = o.blockSize,
        i = this._iv,
        r = this._counter;
      i && (r = this._counter = i.slice(0), this._iv = void 0);
      var s = r.slice(0);
      o.encryptBlock(s, 0), r[n - 1] = r[n - 1] + 1 | 0;
      for (var a = 0; a < n; a++) e[t + a] ^= s[a];
    }
  }), A.Decryptor = O, A), R.mode.CTRGladman = (O = (N = R.lib.BlockCipherMode.extend()).Encryptor = N.extend({
    processBlock: function (e, t) {
      var o = this._cipher,
        n = o.blockSize,
        i = this._iv,
        r = this._counter;
      i && (r = this._counter = i.slice(0), this._iv = void 0), 0 === ((i = r)[0] = L(i[0])) && (i[1] = L(i[1]));
      var s = r.slice(0);
      o.encryptBlock(s, 0);
      for (var a = 0; a < n; a++) e[t + a] ^= s[a];
    }
  }), N.Decryptor = O, N), R.mode.OFB = (O = (A = R.lib.BlockCipherMode.extend()).Encryptor = A.extend({
    processBlock: function (e, t) {
      var o = this._cipher,
        n = o.blockSize,
        i = this._iv,
        r = this._keystream;
      i && (r = this._keystream = i.slice(0), this._iv = void 0), o.encryptBlock(r, 0);
      for (var s = 0; s < n; s++) e[t + s] ^= r[s];
    }
  }), A.Decryptor = O, A), R.mode.ECB = ((N = R.lib.BlockCipherMode.extend()).Encryptor = N.extend({
    processBlock: function (e, t) {
      this._cipher.encryptBlock(e, t);
    }
  }), N.Decryptor = N.extend({
    processBlock: function (e, t) {
      this._cipher.decryptBlock(e, t);
    }
  }), N), R.pad.AnsiX923 = {
    pad: function (e, t) {
      var o = (o = e.sigBytes) + (t = (t *= 4) - o % t) - 1;
      e.clamp(), e.words[o >>> 2] |= t << 24 - o % 4 * 8, e.sigBytes += t;
    },
    unpad: function (e) {
      var t = 255 & e.words[e.sigBytes - 1 >>> 2];
      e.sigBytes -= t;
    }
  }, R.pad.Iso10126 = {
    pad: function (e, t) {
      t *= 4, t -= e.sigBytes % t, e.concat(R.lib.WordArray.random(t - 1)).concat(R.lib.WordArray.create([t << 24], 1));
    },
    unpad: function (e) {
      var t = 255 & e.words[e.sigBytes - 1 >>> 2];
      e.sigBytes -= t;
    }
  }, R.pad.Iso97971 = {
    pad: function (e, t) {
      e.concat(R.lib.WordArray.create([2147483648], 1)), R.pad.ZeroPadding.pad(e, t);
    },
    unpad: function (e) {
      R.pad.ZeroPadding.unpad(e), e.sigBytes--;
    }
  }, R.pad.ZeroPadding = {
    pad: function (e, t) {
      t *= 4, e.clamp(), e.sigBytes += t - (e.sigBytes % t || t);
    },
    unpad: function (e) {
      var t = e.words,
        o = e.sigBytes - 1;
      for (o = e.sigBytes - 1; 0 <= o; o--) if (t[o >>> 2] >>> 24 - o % 4 * 8 & 255) {
        e.sigBytes = o + 1;
        break;
      }
    }
  }, R.pad.NoPadding = {
    pad: function () {},
    unpad: function () {}
  }, z = (O = R).lib.CipherParams, I = O.enc.Hex, O.format.Hex = {
    stringify: function (e) {
      return e.ciphertext.toString(I);
    },
    parse: function (e) {
      return e = I.parse(e), z.create({
        ciphertext: e
      });
    }
  }, function () {
    var e = R,
      t = e.lib.BlockCipher,
      o = e.algo,
      n = [],
      i = [],
      r = [],
      s = [],
      a = [],
      c = [],
      l = [],
      d = [],
      u = [],
      p = [];
    !function () {
      for (var e = [], t = 0; t < 256; t++) e[t] = t < 128 ? t << 1 : t << 1 ^ 283;
      var o = 0,
        g = 0;
      for (t = 0; t < 256; t++) {
        var h = g ^ g << 1 ^ g << 2 ^ g << 3 ^ g << 4;
        n[o] = h = h >>> 8 ^ 255 & h ^ 99;
        var f = e[i[h] = o],
          m = e[f],
          y = e[m],
          _ = 257 * e[h] ^ 16843008 * h;
        r[o] = _ << 24 | _ >>> 8, s[o] = _ << 16 | _ >>> 16, a[o] = _ << 8 | _ >>> 24, c[o] = _, l[h] = (_ = 16843009 * y ^ 65537 * m ^ 257 * f ^ 16843008 * o) << 24 | _ >>> 8, d[h] = _ << 16 | _ >>> 16, u[h] = _ << 8 | _ >>> 24, p[h] = _, o ? (o = f ^ e[e[e[y ^ f]]], g ^= e[e[g]]) : o = g = 1;
      }
    }();
    var g = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
    o = o.AES = t.extend({
      _doReset: function () {
        if (!this._nRounds || this._keyPriorReset !== this._key) {
          for (var e = this._keyPriorReset = this._key, t = e.words, o = e.sigBytes / 4, i = 4 * (1 + (this._nRounds = 6 + o)), r = this._keySchedule = [], s = 0; s < i; s++) s < o ? r[s] = t[s] : (h = r[s - 1], s % o ? 6 < o && s % o == 4 && (h = n[h >>> 24] << 24 | n[h >>> 16 & 255] << 16 | n[h >>> 8 & 255] << 8 | n[255 & h]) : (h = n[(h = h << 8 | h >>> 24) >>> 24] << 24 | n[h >>> 16 & 255] << 16 | n[h >>> 8 & 255] << 8 | n[255 & h], h ^= g[s / o | 0] << 24), r[s] = r[s - o] ^ h);
          for (var a = this._invKeySchedule = [], c = 0; c < i; c++) {
            var h;
            s = i - c, h = c % 4 ? r[s] : r[s - 4], a[c] = c < 4 || s <= 4 ? h : l[n[h >>> 24]] ^ d[n[h >>> 16 & 255]] ^ u[n[h >>> 8 & 255]] ^ p[n[255 & h]];
          }
        }
      },
      encryptBlock: function (e, t) {
        this._doCryptBlock(e, t, this._keySchedule, r, s, a, c, n);
      },
      decryptBlock: function (e, t) {
        var o = e[t + 1];
        e[t + 1] = e[t + 3], e[t + 3] = o, this._doCryptBlock(e, t, this._invKeySchedule, l, d, u, p, i), o = e[t + 1], e[t + 1] = e[t + 3], e[t + 3] = o;
      },
      _doCryptBlock: function (e, t, o, n, i, r, s, a) {
        for (var c = this._nRounds, l = e[t] ^ o[0], d = e[t + 1] ^ o[1], u = e[t + 2] ^ o[2], p = e[t + 3] ^ o[3], g = 4, h = 1; h < c; h++) {
          var f = n[l >>> 24] ^ i[d >>> 16 & 255] ^ r[u >>> 8 & 255] ^ s[255 & p] ^ o[g++],
            m = n[d >>> 24] ^ i[u >>> 16 & 255] ^ r[p >>> 8 & 255] ^ s[255 & l] ^ o[g++],
            y = n[u >>> 24] ^ i[p >>> 16 & 255] ^ r[l >>> 8 & 255] ^ s[255 & d] ^ o[g++],
            _ = n[p >>> 24] ^ i[l >>> 16 & 255] ^ r[d >>> 8 & 255] ^ s[255 & u] ^ o[g++];
          l = f, d = m, u = y, p = _;
        }
        f = (a[l >>> 24] << 24 | a[d >>> 16 & 255] << 16 | a[u >>> 8 & 255] << 8 | a[255 & p]) ^ o[g++], m = (a[d >>> 24] << 24 | a[u >>> 16 & 255] << 16 | a[p >>> 8 & 255] << 8 | a[255 & l]) ^ o[g++], y = (a[u >>> 24] << 24 | a[p >>> 16 & 255] << 16 | a[l >>> 8 & 255] << 8 | a[255 & d]) ^ o[g++], _ = (a[p >>> 24] << 24 | a[l >>> 16 & 255] << 16 | a[d >>> 8 & 255] << 8 | a[255 & u]) ^ o[g++], e[t] = f, e[t + 1] = m, e[t + 2] = y, e[t + 3] = _;
      },
      keySize: 8
    }), e.AES = t._createHelper(o);
  }(), function () {
    var e = R,
      t = (n = e.lib).WordArray,
      o = n.BlockCipher,
      n = e.algo,
      i = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
      r = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
      s = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
      a = [{
        0: 8421888,
        268435456: 32768,
        536870912: 8421378,
        805306368: 2,
        1073741824: 512,
        1342177280: 8421890,
        1610612736: 8389122,
        1879048192: 8388608,
        2147483648: 514,
        2415919104: 8389120,
        2684354560: 33280,
        2952790016: 8421376,
        3221225472: 32770,
        3489660928: 8388610,
        3758096384: 0,
        4026531840: 33282,
        134217728: 0,
        402653184: 8421890,
        671088640: 33282,
        939524096: 32768,
        1207959552: 8421888,
        1476395008: 512,
        1744830464: 8421378,
        2013265920: 2,
        2281701376: 8389120,
        2550136832: 33280,
        2818572288: 8421376,
        3087007744: 8389122,
        3355443200: 8388610,
        3623878656: 32770,
        3892314112: 514,
        4160749568: 8388608,
        1: 32768,
        268435457: 2,
        536870913: 8421888,
        805306369: 8388608,
        1073741825: 8421378,
        1342177281: 33280,
        1610612737: 512,
        1879048193: 8389122,
        2147483649: 8421890,
        2415919105: 8421376,
        2684354561: 8388610,
        2952790017: 33282,
        3221225473: 514,
        3489660929: 8389120,
        3758096385: 32770,
        4026531841: 0,
        134217729: 8421890,
        402653185: 8421376,
        671088641: 8388608,
        939524097: 512,
        1207959553: 32768,
        1476395009: 8388610,
        1744830465: 2,
        2013265921: 33282,
        2281701377: 32770,
        2550136833: 8389122,
        2818572289: 514,
        3087007745: 8421888,
        3355443201: 8389120,
        3623878657: 0,
        3892314113: 33280,
        4160749569: 8421378
      }, {
        0: 1074282512,
        16777216: 16384,
        33554432: 524288,
        50331648: 1074266128,
        67108864: 1073741840,
        83886080: 1074282496,
        100663296: 1073758208,
        117440512: 16,
        134217728: 540672,
        150994944: 1073758224,
        167772160: 1073741824,
        184549376: 540688,
        201326592: 524304,
        218103808: 0,
        234881024: 16400,
        251658240: 1074266112,
        8388608: 1073758208,
        25165824: 540688,
        41943040: 16,
        58720256: 1073758224,
        75497472: 1074282512,
        92274688: 1073741824,
        109051904: 524288,
        125829120: 1074266128,
        142606336: 524304,
        159383552: 0,
        176160768: 16384,
        192937984: 1074266112,
        209715200: 1073741840,
        226492416: 540672,
        243269632: 1074282496,
        260046848: 16400,
        268435456: 0,
        285212672: 1074266128,
        301989888: 1073758224,
        318767104: 1074282496,
        335544320: 1074266112,
        352321536: 16,
        369098752: 540688,
        385875968: 16384,
        402653184: 16400,
        419430400: 524288,
        436207616: 524304,
        452984832: 1073741840,
        469762048: 540672,
        486539264: 1073758208,
        503316480: 1073741824,
        520093696: 1074282512,
        276824064: 540688,
        293601280: 524288,
        310378496: 1074266112,
        327155712: 16384,
        343932928: 1073758208,
        360710144: 1074282512,
        377487360: 16,
        394264576: 1073741824,
        411041792: 1074282496,
        427819008: 1073741840,
        444596224: 1073758224,
        461373440: 524304,
        478150656: 0,
        494927872: 16400,
        511705088: 1074266128,
        528482304: 540672
      }, {
        0: 260,
        1048576: 0,
        2097152: 67109120,
        3145728: 65796,
        4194304: 65540,
        5242880: 67108868,
        6291456: 67174660,
        7340032: 67174400,
        8388608: 67108864,
        9437184: 67174656,
        10485760: 65792,
        11534336: 67174404,
        12582912: 67109124,
        13631488: 65536,
        14680064: 4,
        15728640: 256,
        524288: 67174656,
        1572864: 67174404,
        2621440: 0,
        3670016: 67109120,
        4718592: 67108868,
        5767168: 65536,
        6815744: 65540,
        7864320: 260,
        8912896: 4,
        9961472: 256,
        11010048: 67174400,
        12058624: 65796,
        13107200: 65792,
        14155776: 67109124,
        15204352: 67174660,
        16252928: 67108864,
        16777216: 67174656,
        17825792: 65540,
        18874368: 65536,
        19922944: 67109120,
        20971520: 256,
        22020096: 67174660,
        23068672: 67108868,
        24117248: 0,
        25165824: 67109124,
        26214400: 67108864,
        27262976: 4,
        28311552: 65792,
        29360128: 67174400,
        30408704: 260,
        31457280: 65796,
        32505856: 67174404,
        17301504: 67108864,
        18350080: 260,
        19398656: 67174656,
        20447232: 0,
        21495808: 65540,
        22544384: 67109120,
        23592960: 256,
        24641536: 67174404,
        25690112: 65536,
        26738688: 67174660,
        27787264: 65796,
        28835840: 67108868,
        29884416: 67109124,
        30932992: 67174400,
        31981568: 4,
        33030144: 65792
      }, {
        0: 2151682048,
        65536: 2147487808,
        131072: 4198464,
        196608: 2151677952,
        262144: 0,
        327680: 4198400,
        393216: 2147483712,
        458752: 4194368,
        524288: 2147483648,
        589824: 4194304,
        655360: 64,
        720896: 2147487744,
        786432: 2151678016,
        851968: 4160,
        917504: 4096,
        983040: 2151682112,
        32768: 2147487808,
        98304: 64,
        163840: 2151678016,
        229376: 2147487744,
        294912: 4198400,
        360448: 2151682112,
        425984: 0,
        491520: 2151677952,
        557056: 4096,
        622592: 2151682048,
        688128: 4194304,
        753664: 4160,
        819200: 2147483648,
        884736: 4194368,
        950272: 4198464,
        1015808: 2147483712,
        1048576: 4194368,
        1114112: 4198400,
        1179648: 2147483712,
        1245184: 0,
        1310720: 4160,
        1376256: 2151678016,
        1441792: 2151682048,
        1507328: 2147487808,
        1572864: 2151682112,
        1638400: 2147483648,
        1703936: 2151677952,
        1769472: 4198464,
        1835008: 2147487744,
        1900544: 4194304,
        1966080: 64,
        2031616: 4096,
        1081344: 2151677952,
        1146880: 2151682112,
        1212416: 0,
        1277952: 4198400,
        1343488: 4194368,
        1409024: 2147483648,
        1474560: 2147487808,
        1540096: 64,
        1605632: 2147483712,
        1671168: 4096,
        1736704: 2147487744,
        1802240: 2151678016,
        1867776: 4160,
        1933312: 2151682048,
        1998848: 4194304,
        2064384: 4198464
      }, {
        0: 128,
        4096: 17039360,
        8192: 262144,
        12288: 536870912,
        16384: 537133184,
        20480: 16777344,
        24576: 553648256,
        28672: 262272,
        32768: 16777216,
        36864: 537133056,
        40960: 536871040,
        45056: 553910400,
        49152: 553910272,
        53248: 0,
        57344: 17039488,
        61440: 553648128,
        2048: 17039488,
        6144: 553648256,
        10240: 128,
        14336: 17039360,
        18432: 262144,
        22528: 537133184,
        26624: 553910272,
        30720: 536870912,
        34816: 537133056,
        38912: 0,
        43008: 553910400,
        47104: 16777344,
        51200: 536871040,
        55296: 553648128,
        59392: 16777216,
        63488: 262272,
        65536: 262144,
        69632: 128,
        73728: 536870912,
        77824: 553648256,
        81920: 16777344,
        86016: 553910272,
        90112: 537133184,
        94208: 16777216,
        98304: 553910400,
        102400: 553648128,
        106496: 17039360,
        110592: 537133056,
        114688: 262272,
        118784: 536871040,
        122880: 0,
        126976: 17039488,
        67584: 553648256,
        71680: 16777216,
        75776: 17039360,
        79872: 537133184,
        83968: 536870912,
        88064: 17039488,
        92160: 128,
        96256: 553910272,
        100352: 262272,
        104448: 553910400,
        108544: 0,
        112640: 553648128,
        116736: 16777344,
        120832: 262144,
        124928: 537133056,
        129024: 536871040
      }, {
        0: 268435464,
        256: 8192,
        512: 270532608,
        768: 270540808,
        1024: 268443648,
        1280: 2097152,
        1536: 2097160,
        1792: 268435456,
        2048: 0,
        2304: 268443656,
        2560: 2105344,
        2816: 8,
        3072: 270532616,
        3328: 2105352,
        3584: 8200,
        3840: 270540800,
        128: 270532608,
        384: 270540808,
        640: 8,
        896: 2097152,
        1152: 2105352,
        1408: 268435464,
        1664: 268443648,
        1920: 8200,
        2176: 2097160,
        2432: 8192,
        2688: 268443656,
        2944: 270532616,
        3200: 0,
        3456: 270540800,
        3712: 2105344,
        3968: 268435456,
        4096: 268443648,
        4352: 270532616,
        4608: 270540808,
        4864: 8200,
        5120: 2097152,
        5376: 268435456,
        5632: 268435464,
        5888: 2105344,
        6144: 2105352,
        6400: 0,
        6656: 8,
        6912: 270532608,
        7168: 8192,
        7424: 268443656,
        7680: 270540800,
        7936: 2097160,
        4224: 8,
        4480: 2105344,
        4736: 2097152,
        4992: 268435464,
        5248: 268443648,
        5504: 8200,
        5760: 270540808,
        6016: 270532608,
        6272: 270540800,
        6528: 270532616,
        6784: 8192,
        7040: 2105352,
        7296: 2097160,
        7552: 0,
        7808: 268435456,
        8064: 268443656
      }, {
        0: 1048576,
        16: 33555457,
        32: 1024,
        48: 1049601,
        64: 34604033,
        80: 0,
        96: 1,
        112: 34603009,
        128: 33555456,
        144: 1048577,
        160: 33554433,
        176: 34604032,
        192: 34603008,
        208: 1025,
        224: 1049600,
        240: 33554432,
        8: 34603009,
        24: 0,
        40: 33555457,
        56: 34604032,
        72: 1048576,
        88: 33554433,
        104: 33554432,
        120: 1025,
        136: 1049601,
        152: 33555456,
        168: 34603008,
        184: 1048577,
        200: 1024,
        216: 34604033,
        232: 1,
        248: 1049600,
        256: 33554432,
        272: 1048576,
        288: 33555457,
        304: 34603009,
        320: 1048577,
        336: 33555456,
        352: 34604032,
        368: 1049601,
        384: 1025,
        400: 34604033,
        416: 1049600,
        432: 1,
        448: 0,
        464: 34603008,
        480: 33554433,
        496: 1024,
        264: 1049600,
        280: 33555457,
        296: 34603009,
        312: 1,
        328: 33554432,
        344: 1048576,
        360: 1025,
        376: 34604032,
        392: 33554433,
        408: 34603008,
        424: 0,
        440: 34604033,
        456: 1049601,
        472: 1024,
        488: 33555456,
        504: 1048577
      }, {
        0: 134219808,
        1: 131072,
        2: 134217728,
        3: 32,
        4: 131104,
        5: 134350880,
        6: 134350848,
        7: 2048,
        8: 134348800,
        9: 134219776,
        10: 133120,
        11: 134348832,
        12: 2080,
        13: 0,
        14: 134217760,
        15: 133152,
        2147483648: 2048,
        2147483649: 134350880,
        2147483650: 134219808,
        2147483651: 134217728,
        2147483652: 134348800,
        2147483653: 133120,
        2147483654: 133152,
        2147483655: 32,
        2147483656: 134217760,
        2147483657: 2080,
        2147483658: 131104,
        2147483659: 134350848,
        2147483660: 0,
        2147483661: 134348832,
        2147483662: 134219776,
        2147483663: 131072,
        16: 133152,
        17: 134350848,
        18: 32,
        19: 2048,
        20: 134219776,
        21: 134217760,
        22: 134348832,
        23: 131072,
        24: 0,
        25: 131104,
        26: 134348800,
        27: 134219808,
        28: 134350880,
        29: 133120,
        30: 2080,
        31: 134217728,
        2147483664: 131072,
        2147483665: 2048,
        2147483666: 134348832,
        2147483667: 133152,
        2147483668: 32,
        2147483669: 134348800,
        2147483670: 134217728,
        2147483671: 134219808,
        2147483672: 134350880,
        2147483673: 134217760,
        2147483674: 134219776,
        2147483675: 0,
        2147483676: 133120,
        2147483677: 2080,
        2147483678: 131104,
        2147483679: 134350848
      }],
      c = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],
      l = n.DES = o.extend({
        _doReset: function () {
          for (var e = this._key.words, t = [], o = 0; o < 56; o++) {
            var n = i[o] - 1;
            t[o] = e[n >>> 5] >>> 31 - n % 32 & 1;
          }
          for (var a = this._subKeys = [], c = 0; c < 16; c++) {
            var l = a[c] = [],
              d = s[c];
            for (o = 0; o < 24; o++) l[o / 6 | 0] |= t[(r[o] - 1 + d) % 28] << 31 - o % 6, l[4 + (o / 6 | 0)] |= t[28 + (r[o + 24] - 1 + d) % 28] << 31 - o % 6;
            for (l[0] = l[0] << 1 | l[0] >>> 31, o = 1; o < 7; o++) l[o] = l[o] >>> 4 * (o - 1) + 3;
            l[7] = l[7] << 5 | l[7] >>> 27;
          }
          var u = this._invSubKeys = [];
          for (o = 0; o < 16; o++) u[o] = a[15 - o];
        },
        encryptBlock: function (e, t) {
          this._doCryptBlock(e, t, this._subKeys);
        },
        decryptBlock: function (e, t) {
          this._doCryptBlock(e, t, this._invSubKeys);
        },
        _doCryptBlock: function (e, t, o) {
          this._lBlock = e[t], this._rBlock = e[t + 1], d.call(this, 4, 252645135), d.call(this, 16, 65535), u.call(this, 2, 858993459), u.call(this, 8, 16711935), d.call(this, 1, 1431655765);
          for (var n = 0; n < 16; n++) {
            for (var i = o[n], r = this._lBlock, s = this._rBlock, l = 0, p = 0; p < 8; p++) l |= a[p][((s ^ i[p]) & c[p]) >>> 0];
            this._lBlock = s, this._rBlock = r ^ l;
          }
          var g = this._lBlock;
          this._lBlock = this._rBlock, this._rBlock = g, d.call(this, 1, 1431655765), u.call(this, 8, 16711935), u.call(this, 2, 858993459), d.call(this, 16, 65535), d.call(this, 4, 252645135), e[t] = this._lBlock, e[t + 1] = this._rBlock;
        },
        keySize: 2,
        ivSize: 2,
        blockSize: 2
      });
    function d(e, t) {
      t = (this._lBlock >>> e ^ this._rBlock) & t, this._rBlock ^= t, this._lBlock ^= t << e;
    }
    function u(e, t) {
      t = (this._rBlock >>> e ^ this._lBlock) & t, this._lBlock ^= t, this._rBlock ^= t << e;
    }
    e.DES = o._createHelper(l), n = n.TripleDES = o.extend({
      _doReset: function () {
        if (2 !== (n = this._key.words).length && 4 !== n.length && n.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
        var e = n.slice(0, 2),
          o = n.length < 4 ? n.slice(0, 2) : n.slice(2, 4),
          n = n.length < 6 ? n.slice(0, 2) : n.slice(4, 6);
        this._des1 = l.createEncryptor(t.create(e)), this._des2 = l.createEncryptor(t.create(o)), this._des3 = l.createEncryptor(t.create(n));
      },
      encryptBlock: function (e, t) {
        this._des1.encryptBlock(e, t), this._des2.decryptBlock(e, t), this._des3.encryptBlock(e, t);
      },
      decryptBlock: function (e, t) {
        this._des3.decryptBlock(e, t), this._des2.encryptBlock(e, t), this._des1.decryptBlock(e, t);
      },
      keySize: 6,
      ivSize: 2,
      blockSize: 2
    }), e.TripleDES = o._createHelper(n);
  }(), function () {
    var e = R,
      t = e.lib.StreamCipher,
      o = e.algo,
      n = o.RC4 = t.extend({
        _doReset: function () {
          for (var e = this._key, t = e.words, o = e.sigBytes, n = this._S = [], i = 0; i < 256; i++) n[i] = i;
          i = 0;
          for (var r = 0; i < 256; i++) {
            var s = t[(s = i % o) >>> 2] >>> 24 - s % 4 * 8 & 255;
            r = (r + n[i] + s) % 256, s = n[i], n[i] = n[r], n[r] = s;
          }
          this._i = this._j = 0;
        },
        _doProcessBlock: function (e, t) {
          e[t] ^= i.call(this);
        },
        keySize: 8,
        ivSize: 0
      });
    function i() {
      for (var e = this._S, t = this._i, o = this._j, n = 0, i = 0; i < 4; i++) {
        o = (o + e[t = (t + 1) % 256]) % 256;
        var r = e[t];
        e[t] = e[o], e[o] = r, n |= e[(e[t] + e[o]) % 256] << 24 - 8 * i;
      }
      return this._i = t, this._j = o, n;
    }
    e.RC4 = t._createHelper(n), o = o.RC4Drop = n.extend({
      cfg: n.cfg.extend({
        drop: 192
      }),
      _doReset: function () {
        n._doReset.call(this);
        for (var e = this.cfg.drop; 0 < e; e--) i.call(this);
      }
    }), e.RC4Drop = t._createHelper(o);
  }(), N = (A = R).lib.StreamCipher, O = A.algo, T = [], D = [], E = [], O = O.Rabbit = N.extend({
    _doReset: function () {
      for (var e = this._key.words, t = this.cfg.iv, o = 0; o < 4; o++) e[o] = 16711935 & (e[o] << 8 | e[o] >>> 24) | 4278255360 & (e[o] << 24 | e[o] >>> 8);
      var n = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16],
        i = this._C = [e[2] << 16 | e[2] >>> 16, 4294901760 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 4294901760 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 4294901760 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 4294901760 & e[3] | 65535 & e[0]];
      for (o = this._b = 0; o < 4; o++) j.call(this);
      for (o = 0; o < 8; o++) i[o] ^= n[o + 4 & 7];
      if (t) {
        var r,
          s = (t = 16711935 & ((s = (r = t.words)[0]) << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8)) >>> 16 | 4294901760 & (r = 16711935 & ((a = r[1]) << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8)),
          a = r << 16 | 65535 & t;
        for (i[0] ^= t, i[1] ^= s, i[2] ^= r, i[3] ^= a, i[4] ^= t, i[5] ^= s, i[6] ^= r, i[7] ^= a, o = 0; o < 4; o++) j.call(this);
      }
    },
    _doProcessBlock: function (e, t) {
      var o = this._X;
      j.call(this), T[0] = o[0] ^ o[5] >>> 16 ^ o[3] << 16, T[1] = o[2] ^ o[7] >>> 16 ^ o[5] << 16, T[2] = o[4] ^ o[1] >>> 16 ^ o[7] << 16, T[3] = o[6] ^ o[3] >>> 16 ^ o[1] << 16;
      for (var n = 0; n < 4; n++) T[n] = 16711935 & (T[n] << 8 | T[n] >>> 24) | 4278255360 & (T[n] << 24 | T[n] >>> 8), e[t + n] ^= T[n];
    },
    blockSize: 4,
    ivSize: 2
  }), A.Rabbit = N._createHelper(O), N = (A = R).lib.StreamCipher, O = A.algo, M = [], U = [], H = [], O = O.RabbitLegacy = N.extend({
    _doReset: function () {
      for (var e = this._key.words, t = this.cfg.iv, o = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16], n = this._C = [e[2] << 16 | e[2] >>> 16, 4294901760 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 4294901760 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 4294901760 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 4294901760 & e[3] | 65535 & e[0]], i = this._b = 0; i < 4; i++) X.call(this);
      for (i = 0; i < 8; i++) n[i] ^= o[i + 4 & 7];
      if (t) {
        var r,
          s = (t = 16711935 & ((s = (r = t.words)[0]) << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8)) >>> 16 | 4294901760 & (r = 16711935 & ((e = r[1]) << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8));
        for (e = r << 16 | 65535 & t, n[0] ^= t, n[1] ^= s, n[2] ^= r, n[3] ^= e, n[4] ^= t, n[5] ^= s, n[6] ^= r, n[7] ^= e, i = 0; i < 4; i++) X.call(this);
      }
    },
    _doProcessBlock: function (e, t) {
      var o = this._X;
      X.call(this), M[0] = o[0] ^ o[5] >>> 16 ^ o[3] << 16, M[1] = o[2] ^ o[7] >>> 16 ^ o[5] << 16, M[2] = o[4] ^ o[1] >>> 16 ^ o[7] << 16, M[3] = o[6] ^ o[3] >>> 16 ^ o[1] << 16;
      for (var n = 0; n < 4; n++) M[n] = 16711935 & (M[n] << 8 | M[n] >>> 24) | 4278255360 & (M[n] << 24 | M[n] >>> 8), e[t + n] ^= M[n];
    },
    blockSize: 4,
    ivSize: 2
  }), A.RabbitLegacy = N._createHelper(O), R;
});